dsh-metaphysics 0.62.3 → 0.62.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/client.chenggu.js CHANGED
@@ -1,4 +1,4 @@
1
- window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.chenggu.js",factory(pt){const q={};return q.fail=(function(){return{fail:(U,B)=>{const F=new Error(B);return F.code=U,F}}})(),q.bool=(function(){function R(r,h=!1){return r==null||r===""?h:r===!0||r===1||r==="true"||r==="1"?!0:r===!1||r===0||r==="false"||r==="0"?!1:h}const U={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},B={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function F(r,h){let l=r;const E=($,y)=>{Object.is(r[$],y)||(l===r&&(l={...r}),l[$]=y)},S=$=>{l===r&&(l={...r}),delete l[$]};for(const[$,y]of Object.entries(h))if(r[$]!==void 0){if(typeof r[$]=="string"&&r[$].trim()===""){S($);continue}E($,R(r[$],y))}return l}function Z(r){if(!r||typeof r!="object"||Array.isArray(r))return r;let h=r;for(const[l,E]of Object.entries(B)){if(r[l]===void 0)continue;if(typeof r[l]=="string"&&r[l].trim()===""){h===r&&(h={...r}),delete h[l];continue}const S=R(r[l],E);Object.is(r[l],S)||(h===r&&(h={...r}),h[l]=S)}return h}function N(r){if(!r||typeof r!="object")return r;let h=F(r,U);for(const l of["partner","partner2"]){const E=h[l],S=Z(E);S!==E&&(h===r&&(h={...r}),h[l]=S)}return h}const z=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],L=["lines","rectifyHours","answers"],j=["strokeOverrides","surnameStrokes"],m=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function f(r){if(typeof r!="string")return r;const h=r.trim();if(!m.test(h))return r;const l=Number(h);return Number.isFinite(l)?l:r}function v(r){let h=!1;const l={};for(const[E,S]of Object.entries(r)){const $=S===null?null:f(S);Object.is($,S)||(h=!0),l[E]=$}return h?l:r}function w(r){if(!r||typeof r!="object")return r;let h=r;const l=(E,S)=>{Object.is(r[E],S)||(h===r&&(h={...r}),h[E]=S)};for(const E of z)if(r[E]!==void 0){if(typeof r[E]=="string"&&r[E].trim()===""){h===r&&(h={...r}),delete h[E];continue}l(E,f(r[E]))}for(const E of L){const S=r[E];if(!Array.isArray(S))continue;let $=!1;const y=S.map(a=>{if(a===null)return null;if(typeof a=="string"&&a.trim()===""){$=!0;return}const d=f(a);return Object.is(d,a)||($=!0),d});$&&l(E,y)}for(const E of j){const S=r[E];!S||typeof S!="object"||Array.isArray(S)||l(E,v(S))}return h}return{bool:R,FLAG_DEFAULTS:U,canonicalFlags:N,NUMERIC_KEYS:z,NUMERIC_ARRAY_KEYS:L,NUMERIC_MAP_KEYS:j,canonicalNumbers:w}})(),q.diff=(function(){const{bool:R}=q.bool||{},U=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),B=a=>a!==null&&typeof a=="object";function F(a,d,u="",g=[]){if(a===d)return g;if(!B(a)||!B(d))return g.push({path:u||"(root)",from:a,to:d}),g;const k=new Set([...Object.keys(a),...Object.keys(d)]);for(const I of k){if(U.has(I))continue;const b=u?`${u}.${I}`:I,P=a[I],O=d[I];B(P)&&B(O)?F(P,O,b,g):JSON.stringify(P)!==JSON.stringify(O)&&g.push({path:b,from:P,to:O})}return g}const Z=[[/^pillars\.year\.ganzhi$/,"年柱"],[/^pillars\.month\.ganzhi$/,"月柱"],[/^pillars\.day\.ganzhi$/,"日柱"],[/^pillars\.hour\.ganzhi$/,"时柱"],[/^pillars\.\w+\.hidden/,"藏干"],[/^pillars\.\w+\.stemTenGod$/,"十神"],[/^pillars\.\w+\.kongwang/,"空亡"],[/^pillars\.\w+\.dishi$|^pillars\.\w+\.zizuo$/,"十二长生"],[/^pillars\.\w+\.nayin$/,"纳音"],[/^dayMaster\./,"日主"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\.(palace|branch|stem|ganzhi)$/,"宫位"],[/^palaces\.\d+\.stars\.\d+\.(name|brightness|type)$/,"星曜"],[/^palaces\.\d+\.shensha\./,"神煞"],[/^palaces\.\d+\.(daxian|xiaoxian)\./,"大限"],[/^palaces\.\d+\.sanfang\./,"三方四正"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\./,"命宫"],[/^body\./,"身宫"],[/^doujun\./,"流年斗君"],[/^siZhu\.year$/,"年柱"],[/^siZhu\.month$/,"月柱"],[/^siZhu\.day$/,"日柱"],[/^siZhu\.time$/,"时柱"],[/^ju$|^juNumber$/,"局数"],[/^yuan$/,"三元"],[/^dun$/,"阴阳遁"],[/^daxian(List)?\./,"大限"],[/^fly(Chains|Composite)?\./,"飞星"],[/^pattern/,"格局"],[/^schools\./,"流派回显"],[/^dayun\.jiao\./,"起运"],[/^dayun\.toNextJieDays$/,"起运时间"],[/^dayun\.list\.(\d+)\.ganzhi$/,"大运干支"],[/^dayun\.startAge\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],N=[[/^pillars\./,"四柱"],[/^shensha\./,"神煞"],[/^dayun\./,"大运"],[/^liunian\./,"流年"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^dayMaster\./,"日主"],[/^relations\./,"干支关系"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\.|^body\.|^doujun\./,"命身宫"],[/^siZhu\./,"四柱"],[/^ju$|^juNumber$|^yuan$|^dun$/,"局数"],[/^daxian/,"大限"],[/^fly/,"飞星"],[/^pattern/,"格局"],[/^jieqi\./,"节气"],[/^solarTime\./,"真太阳时"],[/^input\./,"输入回显"],[/^lines\./,"爻"]],z=[[/^pillars\.(year|month|day|hour)\.ganzhi$/,"柱"],[/^palaces\.(minggong|shengong)\.ganzhi$/,"命身宫"],[/^soul\.ganzhi$/,"命宫"],[/^body\.branch$/,"身宫"],[/^siZhu\.(year|month|day|time)$/,"柱"],[/^dayun\.jiao\.at$/,"起运"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^ju$|^juNumber$|^juName$/,"局数"],[/^dun$/,"阴阳遁"],[/^lines\.\d+\.(ganzhi|yinYang|name)$/,"爻"],[/^yueJiang\.(name|zhi)$/,"月将"]];function L(a){for(const[d,u]of Z)if(d.test(a))return u;return j(a)||a}function j(a){for(const[d,u]of N)if(d.test(a))return u;return""}function m(a){for(const[d,u]of z)if(d.test(a))return u;return""}function f(a){return[...a].sort((d,u)=>d.path.localeCompare(u.path,"zh-Hans-CN",{numeric:!0}))}function v(a){if(!a.length)return"本盘不受此口径影响:所有字段一致。";const d=a.filter(I=>m(I.path)),u=[...new Set(a.map(I=>j(I.path)).filter(Boolean))],g=d.length?`根因 ${d.length} 处:`+d.slice(0,4).map(I=>`${L(I.path)} ${w(I.from)}→${w(I.to)}`).join("、")+(d.length>4?" 等":""):"无单一根因",k=u.length?`;连带影响 ${u.slice(0,6).join("、")}${u.length>6?" 等":""} ${u.length} 类,共 ${a.length} 处`:`;共 ${a.length} 处`;return g+k+"。"}const w=a=>a===void 0?"—":a===null?"null":typeof a=="string"?a:Array.isArray(a)?a.join("")||"[]":typeof a=="object"?JSON.stringify(a):String(a);function r(a,{title:d="",limit:u=12}={}){const g=[];if(d&&g.push(`【${d}】`),g.push(v(a)),!a.length)return g.join(`
1
+ window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.chenggu.js",factory(pt){const q={};return q.fail=(function(){return{fail:(U,B)=>{const F=new Error(B);return F.code=U,F}}})(),q.bool=(function(){function R(r,h=!1){return r==null||r===""?h:r===!0||r===1||r==="true"||r==="1"?!0:r===!1||r===0||r==="false"||r==="0"?!1:h}const U={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},B={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function F(r,h){let l=r;const E=($,y)=>{Object.is(r[$],y)||(l===r&&(l={...r}),l[$]=y)},S=$=>{l===r&&(l={...r}),delete l[$]};for(const[$,y]of Object.entries(h))if(r[$]!==void 0){if(typeof r[$]=="string"&&r[$].trim()===""){S($);continue}E($,R(r[$],y))}return l}function Z(r){if(!r||typeof r!="object"||Array.isArray(r))return r;let h=r;for(const[l,E]of Object.entries(B)){if(r[l]===void 0)continue;if(typeof r[l]=="string"&&r[l].trim()===""){h===r&&(h={...r}),delete h[l];continue}const S=R(r[l],E);Object.is(r[l],S)||(h===r&&(h={...r}),h[l]=S)}return h}function N(r){if(!r||typeof r!="object")return r;let h=F(r,U);for(const l of["partner","partner2"]){const E=h[l],S=Z(E);S!==E&&(h===r&&(h={...r}),h[l]=S)}return h}const z=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],L=["lines","rectifyHours","answers"],j=["strokeOverrides","surnameStrokes"],m=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function f(r){if(typeof r!="string")return r;const h=r.trim();if(!m.test(h))return r;const l=Number(h);return Number.isFinite(l)?l:r}function v(r){let h=!1;const l={};for(const[E,S]of Object.entries(r)){const $=S===null?null:f(S);Object.is($,S)||(h=!0),l[E]=$}return h?l:r}function w(r){if(!r||typeof r!="object")return r;let h=r;const l=(E,S)=>{Object.is(r[E],S)||(h===r&&(h={...r}),h[E]=S)};for(const E of z)if(r[E]!==void 0){if(typeof r[E]=="string"&&r[E].trim()===""){h===r&&(h={...r}),delete h[E];continue}l(E,f(r[E]))}for(const E of L){const S=r[E];if(!Array.isArray(S))continue;let $=!1;const y=S.map(a=>{if(a===null)return null;if(typeof a=="string"&&a.trim()===""){$=!0;return}const d=f(a);return Object.is(d,a)||($=!0),d});$&&l(E,y)}for(const E of j){const S=r[E];!S||typeof S!="object"||Array.isArray(S)||l(E,v(S))}return h}return{bool:R,FLAG_DEFAULTS:U,canonicalFlags:N,NUMERIC_KEYS:z,NUMERIC_ARRAY_KEYS:L,NUMERIC_MAP_KEYS:j,canonicalNumbers:w}})(),q.diff=(function(){const{bool:R}=q.bool||{},U=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),B=a=>a!==null&&typeof a=="object";function F(a,d,u="",g=[]){if(a===d)return g;if(!B(a)||!B(d))return g.push({path:u||"(root)",from:a,to:d}),g;const k=new Set([...Object.keys(a),...Object.keys(d)]);for(const I of k){if(U.has(I))continue;const b=u?`${u}.${I}`:I,P=a[I],O=d[I];B(P)&&B(O)?F(P,O,b,g):JSON.stringify(P)!==JSON.stringify(O)&&g.push({path:b,from:P,to:O})}return g}const Z=[[/^pillars\.year\.ganzhi$/,"年柱"],[/^pillars\.month\.ganzhi$/,"月柱"],[/^pillars\.day\.ganzhi$/,"日柱"],[/^pillars\.hour\.ganzhi$/,"时柱"],[/^pillars\.\w+\.hidden/,"藏干"],[/^pillars\.\w+\.stemTenGod$/,"十神"],[/^pillars\.\w+\.kongwang/,"空亡"],[/^pillars\.\w+\.dishi$|^pillars\.\w+\.zizuo$/,"十二长生"],[/^pillars\.\w+\.nayin$/,"纳音"],[/^dayMaster\./,"日主"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\.(palace|branch|stem|ganzhi)$/,"宫位"],[/^palaces\.\d+\.stars\.\d+\.(name|brightness|type)$/,"星曜"],[/^palaces\.\d+\.shensha\./,"神煞"],[/^palaces\.\d+\.(daxian|xiaoxian)\./,"大限"],[/^palaces\.\d+\.sanfang\./,"三方四正"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\./,"命宫"],[/^body\./,"身宫"],[/^doujun\./,"流年斗君"],[/^siZhu\.year$/,"年柱"],[/^siZhu\.month$/,"月柱"],[/^siZhu\.day$/,"日柱"],[/^siZhu\.time$/,"时柱"],[/^ju$|^juNumber$/,"局数"],[/^yuan$/,"三元"],[/^dun$/,"阴阳遁"],[/^daxian(List)?\./,"大限"],[/^fly(Chains|Composite)?\./,"飞星"],[/^pattern/,"格局"],[/^schools\./,"流派回显"],[/^dayun\.jiao\./,"起运"],[/^dayun\.toNextJieDays$/,"起运时间"],[/^dayun\.list\.(\d+)\.ganzhi$/,"大运干支"],[/^dayun\.startAge(Exact)?\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],N=[[/^pillars\./,"四柱"],[/^shensha\./,"神煞"],[/^dayun\./,"大运"],[/^liunian\./,"流年"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^dayMaster\./,"日主"],[/^relations\./,"干支关系"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\.|^body\.|^doujun\./,"命身宫"],[/^siZhu\./,"四柱"],[/^ju$|^juNumber$|^yuan$|^dun$/,"局数"],[/^daxian/,"大限"],[/^fly/,"飞星"],[/^pattern/,"格局"],[/^jieqi\./,"节气"],[/^solarTime\./,"真太阳时"],[/^input\./,"输入回显"],[/^lines\./,"爻"]],z=[[/^pillars\.(year|month|day|hour)\.ganzhi$/,"柱"],[/^palaces\.(minggong|shengong)\.ganzhi$/,"命身宫"],[/^soul\.ganzhi$/,"命宫"],[/^body\.branch$/,"身宫"],[/^siZhu\.(year|month|day|time)$/,"柱"],[/^dayun\.jiao\.at$/,"起运"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^ju$|^juNumber$|^juName$/,"局数"],[/^dun$/,"阴阳遁"],[/^lines\.\d+\.(ganzhi|yinYang|name)$/,"爻"],[/^yueJiang\.(name|zhi)$/,"月将"]];function L(a){for(const[d,u]of Z)if(d.test(a))return u;return j(a)||a}function j(a){for(const[d,u]of N)if(d.test(a))return u;return""}function m(a){for(const[d,u]of z)if(d.test(a))return u;return""}function f(a){return[...a].sort((d,u)=>d.path.localeCompare(u.path,"zh-Hans-CN",{numeric:!0}))}function v(a){if(!a.length)return"本盘不受此口径影响:所有字段一致。";const d=a.filter(I=>m(I.path)),u=[...new Set(a.map(I=>j(I.path)).filter(Boolean))],g=d.length?`根因 ${d.length} 处:`+d.slice(0,4).map(I=>`${L(I.path)} ${w(I.from)}→${w(I.to)}`).join("、")+(d.length>4?" 等":""):"无单一根因",k=u.length?`;连带影响 ${u.slice(0,6).join("、")}${u.length>6?" 等":""} ${u.length} 类,共 ${a.length} 处`:`;共 ${a.length} 处`;return g+k+"。"}const w=a=>a===void 0?"—":a===null?"null":typeof a=="string"?a:Array.isArray(a)?a.join("")||"[]":typeof a=="object"?JSON.stringify(a):String(a);function r(a,{title:d="",limit:u=12}={}){const g=[];if(d&&g.push(`【${d}】`),g.push(v(a)),!a.length)return g.join(`
2
2
  `);const k=f(a.filter(b=>m(b.path))),I=f(a.filter(b=>!m(b.path)));if(k.length){g.push(""),g.push(" 根因(口径直接改动):");for(const b of k)g.push(` ${L(b.path).padEnd(6)} ${w(b.from)} → ${w(b.to)}`)}if(I.length){g.push(""),g.push(` 连带变化(${I.length} 处,展示前 ${Math.min(u,I.length)} 处):`);for(const b of I.slice(0,u))g.push(` ${L(b.path).padEnd(6)} ${w(b.from)} → ${w(b.to)}`);if(I.length>u){const b={};for(const P of I.slice(u)){const O=j(P.path)||"其他";b[O]=(b[O]||0)+1}g.push(" 其余:"+Object.entries(b).map(([P,O])=>`${P} ${O} 处`).join("、"))}}return g.join(`
3
3
  `)}const h=(a,d,u,g,k,I)=>({key:a,title:d,short:u,read:b=>{const P=b[a]!==void 0?b[a]:b.schools&&b.schools[a];return I[P]?P:g},alt:b=>b===k?g:k,label:b=>I[b]||b}),l={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:a=>R(a.lateZi,!0),alt:a=>!a,label:a=>a?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:a=>R(a.trueSolar,!0),alt:a=>!a,label:a=>a?"修正":"不修正"}],ziwei:[{key:"leapMonth",title:"闰月归月:按日切分 / 整月归次月",short:"闰月归月",read:a=>a.leapMonth==="next"||a.leapMonth==="prev"?a.leapMonth:"split",alt:a=>a==="split"?"next":"split",label:a=>({split:"按日切分",next:"整月归次月",prev:"整月归本月"})[a]||a},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:a=>R(a.trueSolar,!0),alt:a=>!a,label:a=>a?"修正":"不修正"},h("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),h("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),h("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),h("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),h("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),h("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣"}),h("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),h("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),h("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"}),h("shenzhuSchool","身主:子午皆火星 / 子铃午火","身主","common","verse",{common:"子午皆火星",verse:"子铃午火(安身主诀逐字)"}),h("zuoyaoSchool","杂曜:49 颗简盘 / 61 颗全表","杂曜全表","minimal","full",{minimal:"49 颗(简盘)",full:"61 颗(加十二颗杂曜)"})],qimen:[{key:"juMethod",title:"取局流派:拆补 / 超神接气 / 置闰",short:"取局流派",read:a=>["chaibu","chaoshen","zhirun"].includes(a.juMethod)?a.juMethod:"chaibu",alt:a=>a==="chaibu"?"zhirun":"chaibu",label:a=>({chaibu:"拆补法",chaoshen:"超神接气",zhirun:"置闰法"})[a]||a},{key:"lateZiHourMode",title:"晚子时:23:00 后归当日 / 次日",short:"晚子时归日",read:a=>a.lateZiHourMode==="next-day"?"next-day":"same-day",alt:a=>a==="next-day"?"same-day":"next-day",label:a=>a==="next-day"?"归次日":"归当日"}]},E={bazi:[{path:"pillars.day.ganzhi",label:"日柱"},{path:"pillars.hour.ganzhi",label:"时柱"},{path:"strength.level",label:"旺衰"},{path:"frame.primaryName",label:"格局"},{path:"frame.yongshen.favor",label:"喜用"},{path:"dayun.jiao.at",label:"起运"}],ziwei:[{path:"soul.ganzhi",label:"命宫"},{path:"body.branch",label:"身宫支"},{path:"bureau.name",label:"五行局"},{path:"bodyMaster",label:"身主"},{path:"daxianList.0.ages",label:"起大限"}],qimen:[{path:"siZhu.day",label:"日柱"},{path:"ju",label:"局数"},{path:"zhiFu.star",label:"值符"},{path:"zhiShi.gate",label:"值使"}]};function S(a,d){let u=a;for(const g of String(d).split(".")){if(u==null)return;u=u[g]}return u}function $(a){return a==null?"—":Array.isArray(a)?a.join("、"):typeof a=="object"?"—":String(a)}function y(a,d,u){return(E[a]||[]).map(k=>{const I=$(S(d,k.path)),b=$(S(u,k.path));return{key:k.path,label:k.label,current:I,alt:b,changed:I!==b}})}return{diffObjects:F,labelOf:L,categoryOf:j,rootOf:m,sortDiffs:f,summarize:v,formatValue:w,renderDiff:r,CALIBER_SWITCHES:l,CALIBER_VIEWS:E,viewCell:$,viewRows:y}})(),q.fingerprint=(function(){const R="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function U(N){return JSON.stringify(B(N))}function B(N){if(N===null)return null;const z=typeof N;if(z==="string")return typeof N.normalize=="function"?N.normalize("NFC"):N;if(z==="number")return Number.isFinite(N)?Object.is(N,-0)?0:N:null;if(z==="boolean")return N;if(Array.isArray(N))return N.map(B);if(z==="object"){const L=Object.create(null);for(const j of Object.keys(N).sort()){const m=N[j];m===void 0||typeof m=="function"||typeof m=="symbol"||(L[j]=B(m))}return L}return null}function F(N){const z=String(N);let L=2166136261,j=2654435769;for(let v=0;v<z.length;v+=1){const w=z.charCodeAt(v);for(const r of[w&255,w>>>8])L=Math.imul(L^r,16777619),j=Math.imul(j^r,2246822507)}let m=(L>>>0)*8+(j>>>29),f="";for(let v=0;v<7;v+=1)f=R[m%32]+f,m=Math.floor(m/32);return f}function Z(N={}){const z=String(N.system||""),L=String(N.version||"dev"),j=N.seed===void 0||N.seed===null||N.seed===""?null:Number(N.seed),m=N.asOf?String(N.asOf):null,f=N.params&&typeof N.params=="object"?N.params:{},v=U({system:z,params:f,seed:j,asOf:m}),w=U({base:v,version:L});return{id:`LY-${F(w)}`,baseId:`LY-${F(v)}`,version:L,system:z,payload:v}}return{canonicalJson:U,shortHash:F,fingerprintOf:Z}})(),q.validate=(function(){const{fail:R}=q.fail||{},U=1600,B=2400;function F(f){return f%4===0&&f%100!==0||f%400===0}function Z(f,v){return v===2?F(f)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][v-1]||0}const N=f=>typeof f=="string"?`「${f}」`:String(f),z="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function L(f,v=""){const w=v?`${v} 的`:"";if(!f||typeof f!="object"||Array.isArray(f)){const E=f===null?"null":Array.isArray(f)?"数组":typeof f;throw R("E_INPUT",`${w}入参必须是对象(收到 ${E});${z}`)}const r=f.hour===void 0?0:f.hour,h=f.minute===void 0?0:f.minute;for(const[E,S]of[["year",f.year],["month",f.month],["day",f.day],["hour",r],["minute",h]])if(!Number.isInteger(S))throw R("E_INPUT",`${w}${E} 必须是整数(收到 ${N(S)});${z}`);if(f.year<U||f.year>B)throw R("E_INPUT",`${w}year 超出支持范围 ${U}–${B}(收到 ${f.year});更早的年份时区与历法口径不可靠`);if(f.month<1||f.month>12)throw R("E_INPUT",`${w}month 超出范围 1–12(收到 ${f.month})`);const l=Z(f.year,f.month);if(f.day<1||f.day>l)throw R("E_INPUT",`${w}日期不存在:${f.year}-${f.month}-${f.day}(${f.year} 年 ${f.month} 月只有 ${l} 天)`);if(r<0||r>23)throw R("E_INPUT",`${w}hour 超出范围 0–23(收到 ${r})`);if(h<0||h>59)throw R("E_INPUT",`${w}minute 超出范围 0–59(收到 ${h})`);return f}function j(f,v,w){if(!f||typeof f!="object"||Array.isArray(f)){const r=f===null?"null":f===void 0?"undefined":Array.isArray(f)?"数组":typeof f;throw R("E_INPUT",`${v} 必须是对象(收到 ${r});${w}`)}return f}function m(f,v=""){const w=v?`${v}:`:"";if(f.year<U||f.year>B)throw R("E_RANGE",`${w}晚子时按次日归后落到 ${f.year}-${String(f.month).padStart(2,"0")}-${String(f.day).padStart(2,"0")},超出可计算范围 ${U}–${B};请把时刻挪到 23 点前,或换一天起课`);return f}return{MIN_YEAR:U,MAX_YEAR:B,isLeapYear:F,daysInMonth:Z,assertCivil:L,assertObject:j,assertShifted:m}})(),q.datetime=(function(){const{fail:R}=q.fail||{},{MIN_YEAR:U,MAX_YEAR:B}=q.validate||{};function F(z,L){return L===2?z%4===0&&z%100!==0||z%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][L-1]}function Z(z,L=""){const j=String(z??"").trim(),m=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(j);if(!m)return null;const f=Number(m[1]),v=Number(m[2]),w=Number(m[3]);if(v<1||v>12||w<1||w>F(f,v))return null;if(f<U||f>B){const r=L?`${L} `:"";throw R("E_RANGE",`${r}「${m[0]}」的年份超出可计算范围(${U}–${B},收到 ${f} 年);农历与节气表不覆盖之外的年份`)}return{year:f,month:v,day:w}}function N(z){if(typeof z!="string"||!z.trim())throw R("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const L=z.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!L)throw R("E_INPUT",`无法解析 datetime:「${z}」,请用 1990-05-12T14:30 这种格式`);if(L[6]!==void 0&&Number(L[6])>59)throw R("E_INPUT",`秒超出范围:${L[6]}`);const j={year:Number(L[1]),month:Number(L[2]),day:Number(L[3]),hour:Number(L[4]??0),minute:Number(L[5]??0)};if(j.month<1||j.month>12)throw R("E_INPUT",`月份超出范围:${j.month}`);const m=F(j.year,j.month);if(j.day<1||j.day>m)throw R("E_INPUT",`日期不存在:${j.year}-${j.month}-${j.day}(${j.year} 年 ${j.month} 月只有 ${m} 天)`);if(j.hour>23||j.minute>59)throw R("E_INPUT",`时间超出范围:${j.hour}:${j.minute}`);if(j.year<U||j.year>B)throw R("E_RANGE",`年份 ${j.year} 超出可计算范围(${U}–${B})`);return(j.year<1900||j.year>2100)&&(j.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${j.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),j}return{daysInMonth:F,parseYmd:Z,parseDateTime:N}})(),q.lru=(function(){function R({max:U=64,ttlMs:B=0,name:F="lru",now:Z=()=>Date.now()}={}){const N=new Map,z={name:F,hits:0,misses:0,evictions:0,expirations:0},L=j=>B>0&&Z()-j.at>B;return{name:F,max:U,ttlMs:B,get(j){const m=N.get(j);if(!m||L(m)){m&&(N.delete(j),z.expirations+=1),z.misses+=1;return}return N.delete(j),N.set(j,m),z.hits+=1,m.value},set(j,m){for(N.has(j)&&N.delete(j),N.set(j,{value:m,at:Z()});N.size>U;)N.delete(N.keys().next().value),z.evictions+=1;return m},has(j){const m=N.get(j);return m?L(m)?(N.delete(j),z.expirations+=1,!1):!0:!1},delete(j){return N.delete(j)},clear(){N.clear()},get size(){return N.size},stats(){const j=z.hits+z.misses;return{name:F,size:N.size,max:U,hits:z.hits,misses:z.misses,evictions:z.evictions,expirations:z.expirations,hitRate:j?z.hits/j:0}}}}return{createLru:R}})(),q.nayin=(function(){const R=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function U(B){const F=(Number(B)%60+60)%60,Z=R[Math.floor(F/2)];return{name:Z,element:Z[2]}}return{NAYIN_NAMES:R,nayinOf:U}})(),q.sanhe=(function(){const R=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],U=Object.fromEntries(R.map(Z=>[Z.branches.join(""),Z.element])),B=Object.fromEntries(R.flatMap(Z=>Z.branches.map(N=>[N,Z.element])));function F(Z){return R.find(N=>N.branches.includes(Z))||null}return{SANHE_GROUPS:R,SANHE:U,SANHE_ELEMENT:B,sanheGroupOf:F}})(),q["vsop-earth"]=(function(){const R=[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[.00034894275,4.62610242189,12566.1516999828],[3417572e-11,2.82886579754,3.523118349],[3497056e-11,2.74411783405,5753.3848848968],[3135899e-11,3.62767041756,77713.7714681205],[2676218e-11,4.41808345438,7860.4193924392],[2342691e-11,6.13516214446,3930.2096962196],[1273165e-11,2.03709657878,529.6909650946],[1324294e-11,.74246341673,11506.7697697936],[901854e-11,2.04505446477,26.2983197998],[1199167e-11,1.10962946234,1577.3435424478],[857223e-11,3.50849152283,398.1490034082],[779786e-11,1.17882681962,5223.6939198022],[99025e-10,5.23268072088,5884.9268465832],[753141e-11,2.53339052847,5507.5532386674],[505267e-11,4.58292599973,18849.2275499742],[492392e-11,4.20505711826,775.522611324],[356672e-11,2.91954114478,.0673103028],[284125e-11,1.89869240932,796.2980068164],[242879e-11,.34481445893,5486.777843175],[317087e-11,5.84901948512,11790.6290886588],[271112e-11,.31486255375,10977.078804699],[206217e-11,4.80646631478,2544.3144198834],[205478e-11,1.86953770281,5573.1428014331],[202318e-11,2.45767790232,6069.7767545534],[126225e-11,1.08295459501,20.7753954924],[155516e-11,.83306084617,213.299095438],[115132e-11,.64544911683,.9803210682],[102851e-11,.63599845579,4694.0029547076],[101724e-11,4.2667980198,7.1135470008],[99206e-11,6.20992926918,2146.1654164752],[132212e-11,3.41118292683,2942.4634232916],[97607e-11,.68101342359,155.4203994342],[85128e-11,1.29870764804,6275.9623029906],[74651e-11,1.755089133,5088.6288397668],[101895e-11,.97569280312,15720.8387848784],[84711e-11,3.67080093031,71430.69561812909],[73547e-11,4.67926633877,801.8209311238],[73874e-11,3.50319414955,3154.6870848956],[78757e-11,3.03697458703,12036.4607348882],[79637e-11,1.80791287082,17260.1546546904],[85803e-11,5.9832263126,161000.6857376741],[56963e-11,2.78430458592,6286.5989683404],[61148e-11,1.81839892984,7084.8967811152],[69627e-11,.83297621398,9437.762934887],[56116e-11,4.38694865354,14143.4952424306],[62449e-11,3.97763912806,8827.3902698748],[51145e-11,.28306832879,5856.4776591154],[55577e-11,3.47006059924,6279.5527316424],[41036e-11,5.36817592855,8429.2412664666],[51605e-11,1.33282739866,1748.016413067],[51992e-11,.18914947184,12139.5535091068],[49e-8,.48735014197,1194.4470102246],[392e-9,6.16833020996,10447.3878396044],[3557e-10,1.775968892,6812.766815086],[3677e-10,6.04133863162,10213.285546211],[36596e-11,2.56957481827,1059.3819301892],[33296e-11,.59310278598,17789.845619785],[35954e-11,1.70875808777,2352.8661537718],[40938e-11,2.39850938714,19651.048481098],[30047e-11,2.73975124088,1349.8674096588],[30412e-11,.44294464169,83996.84731811189],[23663e-11,.48473622521,8031.0922630584],[23574e-11,2.06528133162,3340.6124266998],[21089e-11,4.14825468851,951.7184062506],[24738e-11,.21484762138,3.5904286518],[25352e-11,3.16470891653,4690.4798363586],[22823e-11,5.22195230819,4705.7323075436],[21419e-11,1.42563910473,16730.4636895958],[21891e-11,5.55594302779,553.5694028424],[203e-9,.37133792946,283.8593188652]],U=[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4303419e-11,2.63512233481,12566.1516999828],[425264e-11,1.59046982018,3.523118349],[109017e-11,2.96631010675,1577.3435424478],[93479e-11,2.59211109542,18849.2275499742],[119305e-11,5.79555765566,26.2983197998],[72121e-11,1.13840581212,529.6909650946],[67784e-11,1.87453300345,398.1490034082],[6735e-10,4.40932832004,5507.5532386674],[59045e-11,2.88815790631,5223.6939198022],[55976e-11,2.17471740035,155.4203994342],[45411e-11,.39799502896,796.2980068164],[36298e-11,.46875437227,775.522611324],[28962e-11,2.64732254645,7.1135470008],[20844e-11,5.34138275149,.9803210682]],B=[[8721859e-11,1.07253635559,6283.0758499914],[99099e-10,3.14159265359,0],[294833e-11,.43717350256,12566.1516999828],[27338e-11,.05295636147,3.523118349],[16333e-11,5.18820215724,26.2983197998],[15745e-11,3.68504712183,155.4203994342],[9425e-11,.29667114694,18849.2275499742],[8938e-11,2.05706319592,77713.7714681205],[694e-10,.82691541038,775.522611324],[5061e-11,4.6624323168,1577.3435424478]],F=[[289058e-11,5.84173149732,6283.0758499914],[20712e-11,6.0498393902,12566.1516999828],[2962e-11,5.1956057957,155.4203994342],[2527e-11,3.14159265359,0],[1288e-11,4.7219761197,3.523118349]],Z=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function N(z){let L=0;for(const[m,f,v]of R)L+=m*Math.cos(f+v*z);let j=1;for(const m of[U,B,F,Z]){j*=z;for(const[f,v,w]of m)L+=f*j*Math.cos(v+w*z)}return L}return{earthL:N}})(),q.calendar=(function(){const{earthL:R}=q["vsop-earth"]||{},{createLru:U}=q.lru||{},{bool:B}=q.bool||{},F=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],Z=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],N=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function z(_){return(285+15*_)%360}function L(_,G,C){const ee=Math.floor((14-G)/12),K=_+4800-ee,Y=G+12*ee-3;return C+Math.floor((153*Y+2)/5)+365*K+Math.floor(K/4)-Math.floor(K/100)+Math.floor(K/400)-32045}function j(_){const G=_+32044,C=Math.floor((4*G+3)/146097),ee=G-Math.floor(146097*C/4),K=Math.floor((4*ee+3)/1461),Y=ee-Math.floor(1461*K/4),H=Math.floor((5*Y+2)/153);return{year:100*C+K-4800+Math.floor(H/10),month:H+3-12*Math.floor(H/10),day:Y-Math.floor((153*H+2)/5)+1}}function m(_,G){for(let C=0;C<60;C++)if(C%10===_&&C%12===G)return C;return-1}function f(_){const G=(_%60+60)%60;return{index:G,stem:F[G%10],branch:Z[G%12],name:F[G%10]+Z[G%12]}}function v(_){return((_+49)%60+60)%60}function w(_){const G=_-2451545,C=G/36525,ee=G/365250;let K=R(ee)*180/Math.PI+180;K=(K%360+360)%360;const Y=(5029.0966*C+1.11113*C*C-6e-6*C*C*C)/3600;K+=Y,K-=.09033/3600;const H=(125.04452-1934.136261*C)*Math.PI/180,re=(280.4665+36000.7698*C)*Math.PI/180,oe=(218.3165+481267.8813*C)*Math.PI/180,ge=(-17.2*Math.sin(H)-1.32*Math.sin(2*re)-.23*Math.sin(2*oe)+.21*Math.sin(2*H))/3600;K+=ge;const ie=(357.52911+35999.05029*C-1537e-7*C*C)*Math.PI/180,ye=.016708634-42037e-9*C-1267e-10*C*C,Le=1.000001018*(1-ye*ye)/(1+ye*Math.cos(ie+(1.914602-.004817*C)*(Math.PI/180)*Math.sin(ie)));return K-=20.4898/3600/(Le||1),(K%360+360)%360}function r(_){if(_<1900){const H=_;if(H<1600)return 120;if(H<1700){const oe=H-1600;return 120-.9808*oe-.01532*oe*oe+oe*oe*oe/7129}if(H<1800){const oe=H-1700;return 8.83+.1603*oe-.0059285*oe*oe+13336e-8*oe*oe*oe-oe**4/1174e3}if(H<1860){const oe=H-1800;return 13.72-.332447*oe+.0068612*oe*oe+.0041116*oe**3-37436e-8*oe**4+121272e-10*oe**5-1699e-10*oe**6+875e-12*oe**7}const re=H-1860;return 7.62+.5737*re-.251754*re*re+.01680668*re**3-.0004473624*re**4+re**5/233174}const G=[[1900,-2.8],[1920,21.2],[1940,24.3],[1950,29.1],[1960,33.2],[1970,40.2],[1980,50.5],[1990,56.9],[2e3,63.8],[2010,66.1],[2020,69.4],[2030,72],[2050,80],[2100,110]];if(_<=G[0][0])return G[0][1];for(let H=1;H<G.length;H++)if(_<=G[H][0]){const[re,oe]=G[H-1],[ge,ie]=G[H];return oe+(ie-oe)*(_-re)/(ge-re)}const[C,ee]=G[G.length-1],K=(C-1820)/100,Y=(_-1820)/100;return ee+32*(Y*Y-K*K)}const h=8/24,l=7.7611/24,E=2425612+4/24;function S(_){return _<E?l:h}const $=U({max:4096,name:"termInstant"}),y=1e-5,a=new Map,d=365.2422;function u(_,G){const C=z(G),ee=L(_,1,5)-.5+G*15.2184,K=a.get(G);let Y=K!==void 0?K+d:ee;Math.abs(Y-ee)>20&&(Y=ee);for(let re=0;re<12;re++){let oe=C-w(Y);if(oe=((oe+180)%360+360)%360-180,Y+=oe/.98564736,Math.abs(oe)<y)break}a.set(G,Y);const H=Y-r(_)/86400;return H+S(H)}function g(_,G){const C=_*24+G,ee=$.get(C);if(ee!==void 0)return ee;const K=u(_,G);return $.set(C,K),K}function k(_){const G=Math.floor(_+.5),C=_+.5-G,ee=Math.min(1439,Math.floor(Math.round(C*86400)/60)),{year:K,month:Y,day:H}=j(G);return{year:K,month:Y,day:H,hour:Math.floor(ee/60),minute:ee%60}}function I({year:_,month:G,day:C,hour:ee=0,minute:K=0}){return L(_,G,C)-.5+(ee*60+K)/1440}function b(_,G,C){const ee=L(_,G,C)-L(_,1,1)+1,K=2*Math.PI*(ee-81)/364;return 9.87*Math.sin(2*K)-7.53*Math.cos(K)-1.5*Math.sin(K)}const P=U({max:8,name:"termWindow"}),O=U({max:32,name:"termYear"}),me=Array.from({length:24},(_,G)=>G),we=me.filter(_=>_%2===0);function o(_,G){const C=G?`${_}|jie`:`${_}|all`,ee=O.get(C);if(ee)return ee;if(G){const Y=O.get(`${_}|all`);if(Y){const H=Y.filter(re=>re.index%2===0);return O.set(C,H),H}}const K=[];for(const Y of G?we:me)K.push({year:_,index:Y,name:N[Y],jd:g(_,Y)});return K.sort((Y,H)=>Y.jd-H.jd),O.set(C,K),K}function M(_,G={}){const C=B(G.jieOnly),ee=C?`${_}|jie`:_,K=P.get(ee);if(K)return K;const Y=[...o(_-1,C),...o(_,C),...o(_+1,C)];return Y.sort((H,re)=>H.jd-re.jd),P.set(ee,Y),Y}function J(_){if(typeof _!="string"||_.length<2)return[];const G=F.indexOf(_[0]),C=Z.indexOf(_[1]);if(G<0||C<0)return[];const ee=m(G,C);if(ee<0)return[];const K=Math.floor(ee/10)*10;return[Z[(K+10)%12],Z[(K+11)%12]]}function V(_,G){let C=null;for(const ee of _)if(ee.index%2===0)if(ee.jd<=G)C=ee;else break;return C}function X(_,G){for(const C of _)if(C.index%2===0&&C.jd>G)return C;return null}function te(_){const G=k(_),C=ee=>String(ee).padStart(2,"0");return`${G.year}-${C(G.month)}-${C(G.day)} ${C(G.hour)}:${C(G.minute)}`}function se(){return[$.stats(),O.stats(),P.stats()]}return{STEMS:F,BRANCHES:Z,TERM_NAMES:N,termLongitude:z,toJDN:L,fromJDN:j,sexagenaryIndex:m,ganzhiName:f,dayGanzhiIndex:v,sunLongitude:w,deltaTSeconds:r,OFFSET_MODERN:h,OFFSET_BEIJING_LOCAL:l,CUTOVER_JD:E,localOffsetFor:S,termInstantJd:g,jdToParts:k,partsToJd:I,equationOfTime:b,termWindow:M,xunKongOf:J,previousJie:V,nextJie:X,formatJd:te,cacheMetrics:se}})(),q.lunar=(function(){const{toJDN:R,jdToParts:U,termInstantJd:B,deltaTSeconds:F,localOffsetFor:Z}=q.calendar||{},N=29.530588861,z=245155009766e-5,L=Math.PI/180;function j(r){const h=r/1236.85,l=z+N*r+15437e-8*h*h-15e-8*h*h*h+73e-11*h*h*h*h,E=1-.002516*h-74e-7*h*h,S=(2.5534+29.1053567*r-14e-7*h*h-11e-8*h*h*h)*L,$=(201.5643+385.81693528*r+.0107582*h*h+1238e-8*h*h*h-58e-9*h*h*h*h)*L,y=(160.7108+390.67050284*r-.0016118*h*h-227e-8*h*h*h+11e-9*h*h*h*h)*L,a=(124.7746-1.56375588*r+.0020672*h*h+215e-8*h*h*h)*L,d=-.4072*Math.sin($)+.17241*E*Math.sin(S)+.01608*Math.sin(2*$)+.01039*Math.sin(2*y)+.00739*E*Math.sin($-S)-.00514*E*Math.sin($+S)+.00208*E*E*Math.sin(2*S)-.00111*Math.sin($-2*y)-57e-5*Math.sin($+2*y)+56e-5*E*Math.sin(2*$+S)-42e-5*Math.sin(3*$)+42e-5*E*Math.sin(S+2*y)+38e-5*E*Math.sin(S-2*y)-24e-5*E*Math.sin(2*$-S)-17e-5*Math.sin(a)-7e-5*Math.sin($+2*S)+4e-5*Math.sin(2*$-2*y)+4e-5*Math.sin(3*S)+3e-5*Math.sin($+S-2*y)+3e-5*Math.sin(2*$+2*y)-3e-5*Math.sin($+S+2*y)+3e-5*Math.sin($-S+2*y)-2e-5*Math.sin($-S-2*y)-2e-5*Math.sin(3*$+S)+2e-5*Math.sin(4*$),u=l+d-F(2e3+h*100)/86400;return u+Z(u)}function m(r){return Math.floor(r+.5)}function f(r){return Math.round((r+.5-z)/N)}function v(r,h,l){for(let E=r-1;E<=r+1;E++)for(let S=1;S<24;S+=2){const $=B(E,S),y=m($);if(y>=h&&y<l)return{index:S,jd:$}}return null}function w(r,h,l){const E=R(r,h,l),S=m(B(r,23)),$=E<S?r-1:r,y=m(B($,23));let a=f(y);for(;m(j(a))>y;)a--;for(;m(j(a+1))<=y;)a++;const d=m(B($+1,23));let u=a;for(;m(j(u+1))<=d;)u++;const g=u-a;let k=-1;if(g===13)for(let P=1;P<=g;P++){const O=m(j(a+P-1)),me=m(j(a+P));if(!v($,O,me)){k=P;break}}let I=11,b=!1;for(let P=1;P<=15;P++){const O=m(j(a+P-1)),me=m(j(a+P)),we=v($,O,me),o=P===k;if(E>=O&&E<me){const M=U(j(a+P-1)),J=o?(I+10)%12+1:I;return{year:$,lunarYear:b?$+1:$,month:J,day:E-O+1,isLeap:o,monthStart:`${M.year}-${String(M.month).padStart(2,"0")}-${String(M.day).padStart(2,"0")}`,hasZhongQi:!!we}}o||(I=I%12+1,I===1&&(b=!0))}throw new Error(`农历换算失败:${r}-${h}-${l}`)}return{SYNODIC:N,newMoonJd:j,dayNumberOf:m,solarToLunar:w}})(),q.geo=(function(){const{bool:R}=q.bool||{},U=`
4
4
  北京 116.41 39.90;上海 121.47 31.23;天津 117.20 39.13;重庆 106.55 29.56
package/client.convert.js CHANGED
@@ -1,4 +1,4 @@
1
- window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.convert.js",factory(pt){const q={};return q.fail=(function(){return{fail:(Y,U)=>{const B=new Error(U);return B.code=Y,B}}})(),q.bool=(function(){function L(l,d=!1){return l==null||l===""?d:l===!0||l===1||l==="true"||l==="1"?!0:l===!1||l===0||l==="false"||l==="0"?!1:d}const Y={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},U={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function B(l,d){let u=l;const E=(m,y)=>{Object.is(l[m],y)||(u===l&&(u={...l}),u[m]=y)},S=m=>{u===l&&(u={...l}),delete u[m]};for(const[m,y]of Object.entries(d))if(l[m]!==void 0){if(typeof l[m]=="string"&&l[m].trim()===""){S(m);continue}E(m,L(l[m],y))}return u}function G(l){if(!l||typeof l!="object"||Array.isArray(l))return l;let d=l;for(const[u,E]of Object.entries(U)){if(l[u]===void 0)continue;if(typeof l[u]=="string"&&l[u].trim()===""){d===l&&(d={...l}),delete d[u];continue}const S=L(l[u],E);Object.is(l[u],S)||(d===l&&(d={...l}),d[u]=S)}return d}function N(l){if(!l||typeof l!="object")return l;let d=B(l,Y);for(const u of["partner","partner2"]){const E=d[u],S=G(E);S!==E&&(d===l&&(d={...l}),d[u]=S)}return d}const z=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],P=["lines","rectifyHours","answers"],w=["strokeOverrides","surnameStrokes"],g=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function $(l){if(typeof l!="string")return l;const d=l.trim();if(!g.test(d))return l;const u=Number(d);return Number.isFinite(u)?u:l}function _(l){let d=!1;const u={};for(const[E,S]of Object.entries(l)){const m=S===null?null:$(S);Object.is(m,S)||(d=!0),u[E]=m}return d?u:l}function b(l){if(!l||typeof l!="object")return l;let d=l;const u=(E,S)=>{Object.is(l[E],S)||(d===l&&(d={...l}),d[E]=S)};for(const E of z)if(l[E]!==void 0){if(typeof l[E]=="string"&&l[E].trim()===""){d===l&&(d={...l}),delete d[E];continue}u(E,$(l[E]))}for(const E of P){const S=l[E];if(!Array.isArray(S))continue;let m=!1;const y=S.map(i=>{if(i===null)return null;if(typeof i=="string"&&i.trim()===""){m=!0;return}const s=$(i);return Object.is(s,i)||(m=!0),s});m&&u(E,y)}for(const E of w){const S=l[E];!S||typeof S!="object"||Array.isArray(S)||u(E,_(S))}return d}return{bool:L,FLAG_DEFAULTS:Y,canonicalFlags:N,NUMERIC_KEYS:z,NUMERIC_ARRAY_KEYS:P,NUMERIC_MAP_KEYS:w,canonicalNumbers:b}})(),q.diff=(function(){const{bool:L}=q.bool||{},Y=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),U=i=>i!==null&&typeof i=="object";function B(i,s,c="",f=[]){if(i===s)return f;if(!U(i)||!U(s))return f.push({path:c||"(root)",from:i,to:s}),f;const j=new Set([...Object.keys(i),...Object.keys(s)]);for(const T of j){if(Y.has(T))continue;const x=c?`${c}.${T}`:T,R=i[T],M=s[T];U(R)&&U(M)?B(R,M,x,f):JSON.stringify(R)!==JSON.stringify(M)&&f.push({path:x,from:R,to:M})}return f}const G=[[/^pillars\.year\.ganzhi$/,"年柱"],[/^pillars\.month\.ganzhi$/,"月柱"],[/^pillars\.day\.ganzhi$/,"日柱"],[/^pillars\.hour\.ganzhi$/,"时柱"],[/^pillars\.\w+\.hidden/,"藏干"],[/^pillars\.\w+\.stemTenGod$/,"十神"],[/^pillars\.\w+\.kongwang/,"空亡"],[/^pillars\.\w+\.dishi$|^pillars\.\w+\.zizuo$/,"十二长生"],[/^pillars\.\w+\.nayin$/,"纳音"],[/^dayMaster\./,"日主"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\.(palace|branch|stem|ganzhi)$/,"宫位"],[/^palaces\.\d+\.stars\.\d+\.(name|brightness|type)$/,"星曜"],[/^palaces\.\d+\.shensha\./,"神煞"],[/^palaces\.\d+\.(daxian|xiaoxian)\./,"大限"],[/^palaces\.\d+\.sanfang\./,"三方四正"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\./,"命宫"],[/^body\./,"身宫"],[/^doujun\./,"流年斗君"],[/^siZhu\.year$/,"年柱"],[/^siZhu\.month$/,"月柱"],[/^siZhu\.day$/,"日柱"],[/^siZhu\.time$/,"时柱"],[/^ju$|^juNumber$/,"局数"],[/^yuan$/,"三元"],[/^dun$/,"阴阳遁"],[/^daxian(List)?\./,"大限"],[/^fly(Chains|Composite)?\./,"飞星"],[/^pattern/,"格局"],[/^schools\./,"流派回显"],[/^dayun\.jiao\./,"起运"],[/^dayun\.toNextJieDays$/,"起运时间"],[/^dayun\.list\.(\d+)\.ganzhi$/,"大运干支"],[/^dayun\.startAge\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],N=[[/^pillars\./,"四柱"],[/^shensha\./,"神煞"],[/^dayun\./,"大运"],[/^liunian\./,"流年"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^dayMaster\./,"日主"],[/^relations\./,"干支关系"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\.|^body\.|^doujun\./,"命身宫"],[/^siZhu\./,"四柱"],[/^ju$|^juNumber$|^yuan$|^dun$/,"局数"],[/^daxian/,"大限"],[/^fly/,"飞星"],[/^pattern/,"格局"],[/^jieqi\./,"节气"],[/^solarTime\./,"真太阳时"],[/^input\./,"输入回显"],[/^lines\./,"爻"]],z=[[/^pillars\.(year|month|day|hour)\.ganzhi$/,"柱"],[/^palaces\.(minggong|shengong)\.ganzhi$/,"命身宫"],[/^soul\.ganzhi$/,"命宫"],[/^body\.branch$/,"身宫"],[/^siZhu\.(year|month|day|time)$/,"柱"],[/^dayun\.jiao\.at$/,"起运"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^ju$|^juNumber$|^juName$/,"局数"],[/^dun$/,"阴阳遁"],[/^lines\.\d+\.(ganzhi|yinYang|name)$/,"爻"],[/^yueJiang\.(name|zhi)$/,"月将"]];function P(i){for(const[s,c]of G)if(s.test(i))return c;return w(i)||i}function w(i){for(const[s,c]of N)if(s.test(i))return c;return""}function g(i){for(const[s,c]of z)if(s.test(i))return c;return""}function $(i){return[...i].sort((s,c)=>s.path.localeCompare(c.path,"zh-Hans-CN",{numeric:!0}))}function _(i){if(!i.length)return"本盘不受此口径影响:所有字段一致。";const s=i.filter(T=>g(T.path)),c=[...new Set(i.map(T=>w(T.path)).filter(Boolean))],f=s.length?`根因 ${s.length} 处:`+s.slice(0,4).map(T=>`${P(T.path)} ${b(T.from)}→${b(T.to)}`).join("、")+(s.length>4?" 等":""):"无单一根因",j=c.length?`;连带影响 ${c.slice(0,6).join("、")}${c.length>6?" 等":""} ${c.length} 类,共 ${i.length} 处`:`;共 ${i.length} 处`;return f+j+"。"}const b=i=>i===void 0?"—":i===null?"null":typeof i=="string"?i:Array.isArray(i)?i.join("")||"[]":typeof i=="object"?JSON.stringify(i):String(i);function l(i,{title:s="",limit:c=12}={}){const f=[];if(s&&f.push(`【${s}】`),f.push(_(i)),!i.length)return f.join(`
1
+ window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.convert.js",factory(pt){const q={};return q.fail=(function(){return{fail:(Y,U)=>{const B=new Error(U);return B.code=Y,B}}})(),q.bool=(function(){function L(l,d=!1){return l==null||l===""?d:l===!0||l===1||l==="true"||l==="1"?!0:l===!1||l===0||l==="false"||l==="0"?!1:d}const Y={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},U={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function B(l,d){let u=l;const E=(m,y)=>{Object.is(l[m],y)||(u===l&&(u={...l}),u[m]=y)},S=m=>{u===l&&(u={...l}),delete u[m]};for(const[m,y]of Object.entries(d))if(l[m]!==void 0){if(typeof l[m]=="string"&&l[m].trim()===""){S(m);continue}E(m,L(l[m],y))}return u}function G(l){if(!l||typeof l!="object"||Array.isArray(l))return l;let d=l;for(const[u,E]of Object.entries(U)){if(l[u]===void 0)continue;if(typeof l[u]=="string"&&l[u].trim()===""){d===l&&(d={...l}),delete d[u];continue}const S=L(l[u],E);Object.is(l[u],S)||(d===l&&(d={...l}),d[u]=S)}return d}function N(l){if(!l||typeof l!="object")return l;let d=B(l,Y);for(const u of["partner","partner2"]){const E=d[u],S=G(E);S!==E&&(d===l&&(d={...l}),d[u]=S)}return d}const z=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],P=["lines","rectifyHours","answers"],w=["strokeOverrides","surnameStrokes"],g=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function $(l){if(typeof l!="string")return l;const d=l.trim();if(!g.test(d))return l;const u=Number(d);return Number.isFinite(u)?u:l}function _(l){let d=!1;const u={};for(const[E,S]of Object.entries(l)){const m=S===null?null:$(S);Object.is(m,S)||(d=!0),u[E]=m}return d?u:l}function b(l){if(!l||typeof l!="object")return l;let d=l;const u=(E,S)=>{Object.is(l[E],S)||(d===l&&(d={...l}),d[E]=S)};for(const E of z)if(l[E]!==void 0){if(typeof l[E]=="string"&&l[E].trim()===""){d===l&&(d={...l}),delete d[E];continue}u(E,$(l[E]))}for(const E of P){const S=l[E];if(!Array.isArray(S))continue;let m=!1;const y=S.map(i=>{if(i===null)return null;if(typeof i=="string"&&i.trim()===""){m=!0;return}const s=$(i);return Object.is(s,i)||(m=!0),s});m&&u(E,y)}for(const E of w){const S=l[E];!S||typeof S!="object"||Array.isArray(S)||u(E,_(S))}return d}return{bool:L,FLAG_DEFAULTS:Y,canonicalFlags:N,NUMERIC_KEYS:z,NUMERIC_ARRAY_KEYS:P,NUMERIC_MAP_KEYS:w,canonicalNumbers:b}})(),q.diff=(function(){const{bool:L}=q.bool||{},Y=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),U=i=>i!==null&&typeof i=="object";function B(i,s,c="",f=[]){if(i===s)return f;if(!U(i)||!U(s))return f.push({path:c||"(root)",from:i,to:s}),f;const j=new Set([...Object.keys(i),...Object.keys(s)]);for(const T of j){if(Y.has(T))continue;const x=c?`${c}.${T}`:T,R=i[T],M=s[T];U(R)&&U(M)?B(R,M,x,f):JSON.stringify(R)!==JSON.stringify(M)&&f.push({path:x,from:R,to:M})}return f}const G=[[/^pillars\.year\.ganzhi$/,"年柱"],[/^pillars\.month\.ganzhi$/,"月柱"],[/^pillars\.day\.ganzhi$/,"日柱"],[/^pillars\.hour\.ganzhi$/,"时柱"],[/^pillars\.\w+\.hidden/,"藏干"],[/^pillars\.\w+\.stemTenGod$/,"十神"],[/^pillars\.\w+\.kongwang/,"空亡"],[/^pillars\.\w+\.dishi$|^pillars\.\w+\.zizuo$/,"十二长生"],[/^pillars\.\w+\.nayin$/,"纳音"],[/^dayMaster\./,"日主"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\.(palace|branch|stem|ganzhi)$/,"宫位"],[/^palaces\.\d+\.stars\.\d+\.(name|brightness|type)$/,"星曜"],[/^palaces\.\d+\.shensha\./,"神煞"],[/^palaces\.\d+\.(daxian|xiaoxian)\./,"大限"],[/^palaces\.\d+\.sanfang\./,"三方四正"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\./,"命宫"],[/^body\./,"身宫"],[/^doujun\./,"流年斗君"],[/^siZhu\.year$/,"年柱"],[/^siZhu\.month$/,"月柱"],[/^siZhu\.day$/,"日柱"],[/^siZhu\.time$/,"时柱"],[/^ju$|^juNumber$/,"局数"],[/^yuan$/,"三元"],[/^dun$/,"阴阳遁"],[/^daxian(List)?\./,"大限"],[/^fly(Chains|Composite)?\./,"飞星"],[/^pattern/,"格局"],[/^schools\./,"流派回显"],[/^dayun\.jiao\./,"起运"],[/^dayun\.toNextJieDays$/,"起运时间"],[/^dayun\.list\.(\d+)\.ganzhi$/,"大运干支"],[/^dayun\.startAge(Exact)?\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],N=[[/^pillars\./,"四柱"],[/^shensha\./,"神煞"],[/^dayun\./,"大运"],[/^liunian\./,"流年"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^dayMaster\./,"日主"],[/^relations\./,"干支关系"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\.|^body\.|^doujun\./,"命身宫"],[/^siZhu\./,"四柱"],[/^ju$|^juNumber$|^yuan$|^dun$/,"局数"],[/^daxian/,"大限"],[/^fly/,"飞星"],[/^pattern/,"格局"],[/^jieqi\./,"节气"],[/^solarTime\./,"真太阳时"],[/^input\./,"输入回显"],[/^lines\./,"爻"]],z=[[/^pillars\.(year|month|day|hour)\.ganzhi$/,"柱"],[/^palaces\.(minggong|shengong)\.ganzhi$/,"命身宫"],[/^soul\.ganzhi$/,"命宫"],[/^body\.branch$/,"身宫"],[/^siZhu\.(year|month|day|time)$/,"柱"],[/^dayun\.jiao\.at$/,"起运"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^ju$|^juNumber$|^juName$/,"局数"],[/^dun$/,"阴阳遁"],[/^lines\.\d+\.(ganzhi|yinYang|name)$/,"爻"],[/^yueJiang\.(name|zhi)$/,"月将"]];function P(i){for(const[s,c]of G)if(s.test(i))return c;return w(i)||i}function w(i){for(const[s,c]of N)if(s.test(i))return c;return""}function g(i){for(const[s,c]of z)if(s.test(i))return c;return""}function $(i){return[...i].sort((s,c)=>s.path.localeCompare(c.path,"zh-Hans-CN",{numeric:!0}))}function _(i){if(!i.length)return"本盘不受此口径影响:所有字段一致。";const s=i.filter(T=>g(T.path)),c=[...new Set(i.map(T=>w(T.path)).filter(Boolean))],f=s.length?`根因 ${s.length} 处:`+s.slice(0,4).map(T=>`${P(T.path)} ${b(T.from)}→${b(T.to)}`).join("、")+(s.length>4?" 等":""):"无单一根因",j=c.length?`;连带影响 ${c.slice(0,6).join("、")}${c.length>6?" 等":""} ${c.length} 类,共 ${i.length} 处`:`;共 ${i.length} 处`;return f+j+"。"}const b=i=>i===void 0?"—":i===null?"null":typeof i=="string"?i:Array.isArray(i)?i.join("")||"[]":typeof i=="object"?JSON.stringify(i):String(i);function l(i,{title:s="",limit:c=12}={}){const f=[];if(s&&f.push(`【${s}】`),f.push(_(i)),!i.length)return f.join(`
2
2
  `);const j=$(i.filter(x=>g(x.path))),T=$(i.filter(x=>!g(x.path)));if(j.length){f.push(""),f.push(" 根因(口径直接改动):");for(const x of j)f.push(` ${P(x.path).padEnd(6)} ${b(x.from)} → ${b(x.to)}`)}if(T.length){f.push(""),f.push(` 连带变化(${T.length} 处,展示前 ${Math.min(c,T.length)} 处):`);for(const x of T.slice(0,c))f.push(` ${P(x.path).padEnd(6)} ${b(x.from)} → ${b(x.to)}`);if(T.length>c){const x={};for(const R of T.slice(c)){const M=w(R.path)||"其他";x[M]=(x[M]||0)+1}f.push(" 其余:"+Object.entries(x).map(([R,M])=>`${R} ${M} 处`).join("、"))}}return f.join(`
3
3
  `)}const d=(i,s,c,f,j,T)=>({key:i,title:s,short:c,read:x=>{const R=x[i]!==void 0?x[i]:x.schools&&x.schools[i];return T[R]?R:f},alt:x=>x===j?f:j,label:x=>T[x]||x}),u={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:i=>L(i.lateZi,!0),alt:i=>!i,label:i=>i?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:i=>L(i.trueSolar,!0),alt:i=>!i,label:i=>i?"修正":"不修正"}],ziwei:[{key:"leapMonth",title:"闰月归月:按日切分 / 整月归次月",short:"闰月归月",read:i=>i.leapMonth==="next"||i.leapMonth==="prev"?i.leapMonth:"split",alt:i=>i==="split"?"next":"split",label:i=>({split:"按日切分",next:"整月归次月",prev:"整月归本月"})[i]||i},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:i=>L(i.trueSolar,!0),alt:i=>!i,label:i=>i?"修正":"不修正"},d("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),d("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),d("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),d("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),d("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),d("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣"}),d("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),d("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),d("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"}),d("shenzhuSchool","身主:子午皆火星 / 子铃午火","身主","common","verse",{common:"子午皆火星",verse:"子铃午火(安身主诀逐字)"}),d("zuoyaoSchool","杂曜:49 颗简盘 / 61 颗全表","杂曜全表","minimal","full",{minimal:"49 颗(简盘)",full:"61 颗(加十二颗杂曜)"})],qimen:[{key:"juMethod",title:"取局流派:拆补 / 超神接气 / 置闰",short:"取局流派",read:i=>["chaibu","chaoshen","zhirun"].includes(i.juMethod)?i.juMethod:"chaibu",alt:i=>i==="chaibu"?"zhirun":"chaibu",label:i=>({chaibu:"拆补法",chaoshen:"超神接气",zhirun:"置闰法"})[i]||i},{key:"lateZiHourMode",title:"晚子时:23:00 后归当日 / 次日",short:"晚子时归日",read:i=>i.lateZiHourMode==="next-day"?"next-day":"same-day",alt:i=>i==="next-day"?"same-day":"next-day",label:i=>i==="next-day"?"归次日":"归当日"}]},E={bazi:[{path:"pillars.day.ganzhi",label:"日柱"},{path:"pillars.hour.ganzhi",label:"时柱"},{path:"strength.level",label:"旺衰"},{path:"frame.primaryName",label:"格局"},{path:"frame.yongshen.favor",label:"喜用"},{path:"dayun.jiao.at",label:"起运"}],ziwei:[{path:"soul.ganzhi",label:"命宫"},{path:"body.branch",label:"身宫支"},{path:"bureau.name",label:"五行局"},{path:"bodyMaster",label:"身主"},{path:"daxianList.0.ages",label:"起大限"}],qimen:[{path:"siZhu.day",label:"日柱"},{path:"ju",label:"局数"},{path:"zhiFu.star",label:"值符"},{path:"zhiShi.gate",label:"值使"}]};function S(i,s){let c=i;for(const f of String(s).split(".")){if(c==null)return;c=c[f]}return c}function m(i){return i==null?"—":Array.isArray(i)?i.join("、"):typeof i=="object"?"—":String(i)}function y(i,s,c){return(E[i]||[]).map(j=>{const T=m(S(s,j.path)),x=m(S(c,j.path));return{key:j.path,label:j.label,current:T,alt:x,changed:T!==x}})}return{diffObjects:B,labelOf:P,categoryOf:w,rootOf:g,sortDiffs:$,summarize:_,formatValue:b,renderDiff:l,CALIBER_SWITCHES:u,CALIBER_VIEWS:E,viewCell:m,viewRows:y}})(),q.fingerprint=(function(){const L="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Y(N){return JSON.stringify(U(N))}function U(N){if(N===null)return null;const z=typeof N;if(z==="string")return typeof N.normalize=="function"?N.normalize("NFC"):N;if(z==="number")return Number.isFinite(N)?Object.is(N,-0)?0:N:null;if(z==="boolean")return N;if(Array.isArray(N))return N.map(U);if(z==="object"){const P=Object.create(null);for(const w of Object.keys(N).sort()){const g=N[w];g===void 0||typeof g=="function"||typeof g=="symbol"||(P[w]=U(g))}return P}return null}function B(N){const z=String(N);let P=2166136261,w=2654435769;for(let _=0;_<z.length;_+=1){const b=z.charCodeAt(_);for(const l of[b&255,b>>>8])P=Math.imul(P^l,16777619),w=Math.imul(w^l,2246822507)}let g=(P>>>0)*8+(w>>>29),$="";for(let _=0;_<7;_+=1)$=L[g%32]+$,g=Math.floor(g/32);return $}function G(N={}){const z=String(N.system||""),P=String(N.version||"dev"),w=N.seed===void 0||N.seed===null||N.seed===""?null:Number(N.seed),g=N.asOf?String(N.asOf):null,$=N.params&&typeof N.params=="object"?N.params:{},_=Y({system:z,params:$,seed:w,asOf:g}),b=Y({base:_,version:P});return{id:`LY-${B(b)}`,baseId:`LY-${B(_)}`,version:P,system:z,payload:_}}return{canonicalJson:Y,shortHash:B,fingerprintOf:G}})(),q.validate=(function(){const{fail:L}=q.fail||{},Y=1600,U=2400;function B($){return $%4===0&&$%100!==0||$%400===0}function G($,_){return _===2?B($)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][_-1]||0}const N=$=>typeof $=="string"?`「${$}」`:String($),z="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function P($,_=""){const b=_?`${_} 的`:"";if(!$||typeof $!="object"||Array.isArray($)){const E=$===null?"null":Array.isArray($)?"数组":typeof $;throw L("E_INPUT",`${b}入参必须是对象(收到 ${E});${z}`)}const l=$.hour===void 0?0:$.hour,d=$.minute===void 0?0:$.minute;for(const[E,S]of[["year",$.year],["month",$.month],["day",$.day],["hour",l],["minute",d]])if(!Number.isInteger(S))throw L("E_INPUT",`${b}${E} 必须是整数(收到 ${N(S)});${z}`);if($.year<Y||$.year>U)throw L("E_INPUT",`${b}year 超出支持范围 ${Y}–${U}(收到 ${$.year});更早的年份时区与历法口径不可靠`);if($.month<1||$.month>12)throw L("E_INPUT",`${b}month 超出范围 1–12(收到 ${$.month})`);const u=G($.year,$.month);if($.day<1||$.day>u)throw L("E_INPUT",`${b}日期不存在:${$.year}-${$.month}-${$.day}(${$.year} 年 ${$.month} 月只有 ${u} 天)`);if(l<0||l>23)throw L("E_INPUT",`${b}hour 超出范围 0–23(收到 ${l})`);if(d<0||d>59)throw L("E_INPUT",`${b}minute 超出范围 0–59(收到 ${d})`);return $}function w($,_,b){if(!$||typeof $!="object"||Array.isArray($)){const l=$===null?"null":$===void 0?"undefined":Array.isArray($)?"数组":typeof $;throw L("E_INPUT",`${_} 必须是对象(收到 ${l});${b}`)}return $}function g($,_=""){const b=_?`${_}:`:"";if($.year<Y||$.year>U)throw L("E_RANGE",`${b}晚子时按次日归后落到 ${$.year}-${String($.month).padStart(2,"0")}-${String($.day).padStart(2,"0")},超出可计算范围 ${Y}–${U};请把时刻挪到 23 点前,或换一天起课`);return $}return{MIN_YEAR:Y,MAX_YEAR:U,isLeapYear:B,daysInMonth:G,assertCivil:P,assertObject:w,assertShifted:g}})(),q.datetime=(function(){const{fail:L}=q.fail||{},{MIN_YEAR:Y,MAX_YEAR:U}=q.validate||{};function B(z,P){return P===2?z%4===0&&z%100!==0||z%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][P-1]}function G(z,P=""){const w=String(z??"").trim(),g=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(w);if(!g)return null;const $=Number(g[1]),_=Number(g[2]),b=Number(g[3]);if(_<1||_>12||b<1||b>B($,_))return null;if($<Y||$>U){const l=P?`${P} `:"";throw L("E_RANGE",`${l}「${g[0]}」的年份超出可计算范围(${Y}–${U},收到 ${$} 年);农历与节气表不覆盖之外的年份`)}return{year:$,month:_,day:b}}function N(z){if(typeof z!="string"||!z.trim())throw L("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const P=z.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!P)throw L("E_INPUT",`无法解析 datetime:「${z}」,请用 1990-05-12T14:30 这种格式`);if(P[6]!==void 0&&Number(P[6])>59)throw L("E_INPUT",`秒超出范围:${P[6]}`);const w={year:Number(P[1]),month:Number(P[2]),day:Number(P[3]),hour:Number(P[4]??0),minute:Number(P[5]??0)};if(w.month<1||w.month>12)throw L("E_INPUT",`月份超出范围:${w.month}`);const g=B(w.year,w.month);if(w.day<1||w.day>g)throw L("E_INPUT",`日期不存在:${w.year}-${w.month}-${w.day}(${w.year} 年 ${w.month} 月只有 ${g} 天)`);if(w.hour>23||w.minute>59)throw L("E_INPUT",`时间超出范围:${w.hour}:${w.minute}`);if(w.year<Y||w.year>U)throw L("E_RANGE",`年份 ${w.year} 超出可计算范围(${Y}–${U})`);return(w.year<1900||w.year>2100)&&(w.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${w.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),w}return{daysInMonth:B,parseYmd:G,parseDateTime:N}})(),q.lru=(function(){function L({max:Y=64,ttlMs:U=0,name:B="lru",now:G=()=>Date.now()}={}){const N=new Map,z={name:B,hits:0,misses:0,evictions:0,expirations:0},P=w=>U>0&&G()-w.at>U;return{name:B,max:Y,ttlMs:U,get(w){const g=N.get(w);if(!g||P(g)){g&&(N.delete(w),z.expirations+=1),z.misses+=1;return}return N.delete(w),N.set(w,g),z.hits+=1,g.value},set(w,g){for(N.has(w)&&N.delete(w),N.set(w,{value:g,at:G()});N.size>Y;)N.delete(N.keys().next().value),z.evictions+=1;return g},has(w){const g=N.get(w);return g?P(g)?(N.delete(w),z.expirations+=1,!1):!0:!1},delete(w){return N.delete(w)},clear(){N.clear()},get size(){return N.size},stats(){const w=z.hits+z.misses;return{name:B,size:N.size,max:Y,hits:z.hits,misses:z.misses,evictions:z.evictions,expirations:z.expirations,hitRate:w?z.hits/w:0}}}}return{createLru:L}})(),q.nayin=(function(){const L=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function Y(U){const B=(Number(U)%60+60)%60,G=L[Math.floor(B/2)];return{name:G,element:G[2]}}return{NAYIN_NAMES:L,nayinOf:Y}})(),q.sanhe=(function(){const L=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],Y=Object.fromEntries(L.map(G=>[G.branches.join(""),G.element])),U=Object.fromEntries(L.flatMap(G=>G.branches.map(N=>[N,G.element])));function B(G){return L.find(N=>N.branches.includes(G))||null}return{SANHE_GROUPS:L,SANHE:Y,SANHE_ELEMENT:U,sanheGroupOf:B}})(),q["vsop-earth"]=(function(){const L=[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[.00034894275,4.62610242189,12566.1516999828],[3417572e-11,2.82886579754,3.523118349],[3497056e-11,2.74411783405,5753.3848848968],[3135899e-11,3.62767041756,77713.7714681205],[2676218e-11,4.41808345438,7860.4193924392],[2342691e-11,6.13516214446,3930.2096962196],[1273165e-11,2.03709657878,529.6909650946],[1324294e-11,.74246341673,11506.7697697936],[901854e-11,2.04505446477,26.2983197998],[1199167e-11,1.10962946234,1577.3435424478],[857223e-11,3.50849152283,398.1490034082],[779786e-11,1.17882681962,5223.6939198022],[99025e-10,5.23268072088,5884.9268465832],[753141e-11,2.53339052847,5507.5532386674],[505267e-11,4.58292599973,18849.2275499742],[492392e-11,4.20505711826,775.522611324],[356672e-11,2.91954114478,.0673103028],[284125e-11,1.89869240932,796.2980068164],[242879e-11,.34481445893,5486.777843175],[317087e-11,5.84901948512,11790.6290886588],[271112e-11,.31486255375,10977.078804699],[206217e-11,4.80646631478,2544.3144198834],[205478e-11,1.86953770281,5573.1428014331],[202318e-11,2.45767790232,6069.7767545534],[126225e-11,1.08295459501,20.7753954924],[155516e-11,.83306084617,213.299095438],[115132e-11,.64544911683,.9803210682],[102851e-11,.63599845579,4694.0029547076],[101724e-11,4.2667980198,7.1135470008],[99206e-11,6.20992926918,2146.1654164752],[132212e-11,3.41118292683,2942.4634232916],[97607e-11,.68101342359,155.4203994342],[85128e-11,1.29870764804,6275.9623029906],[74651e-11,1.755089133,5088.6288397668],[101895e-11,.97569280312,15720.8387848784],[84711e-11,3.67080093031,71430.69561812909],[73547e-11,4.67926633877,801.8209311238],[73874e-11,3.50319414955,3154.6870848956],[78757e-11,3.03697458703,12036.4607348882],[79637e-11,1.80791287082,17260.1546546904],[85803e-11,5.9832263126,161000.6857376741],[56963e-11,2.78430458592,6286.5989683404],[61148e-11,1.81839892984,7084.8967811152],[69627e-11,.83297621398,9437.762934887],[56116e-11,4.38694865354,14143.4952424306],[62449e-11,3.97763912806,8827.3902698748],[51145e-11,.28306832879,5856.4776591154],[55577e-11,3.47006059924,6279.5527316424],[41036e-11,5.36817592855,8429.2412664666],[51605e-11,1.33282739866,1748.016413067],[51992e-11,.18914947184,12139.5535091068],[49e-8,.48735014197,1194.4470102246],[392e-9,6.16833020996,10447.3878396044],[3557e-10,1.775968892,6812.766815086],[3677e-10,6.04133863162,10213.285546211],[36596e-11,2.56957481827,1059.3819301892],[33296e-11,.59310278598,17789.845619785],[35954e-11,1.70875808777,2352.8661537718],[40938e-11,2.39850938714,19651.048481098],[30047e-11,2.73975124088,1349.8674096588],[30412e-11,.44294464169,83996.84731811189],[23663e-11,.48473622521,8031.0922630584],[23574e-11,2.06528133162,3340.6124266998],[21089e-11,4.14825468851,951.7184062506],[24738e-11,.21484762138,3.5904286518],[25352e-11,3.16470891653,4690.4798363586],[22823e-11,5.22195230819,4705.7323075436],[21419e-11,1.42563910473,16730.4636895958],[21891e-11,5.55594302779,553.5694028424],[203e-9,.37133792946,283.8593188652]],Y=[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4303419e-11,2.63512233481,12566.1516999828],[425264e-11,1.59046982018,3.523118349],[109017e-11,2.96631010675,1577.3435424478],[93479e-11,2.59211109542,18849.2275499742],[119305e-11,5.79555765566,26.2983197998],[72121e-11,1.13840581212,529.6909650946],[67784e-11,1.87453300345,398.1490034082],[6735e-10,4.40932832004,5507.5532386674],[59045e-11,2.88815790631,5223.6939198022],[55976e-11,2.17471740035,155.4203994342],[45411e-11,.39799502896,796.2980068164],[36298e-11,.46875437227,775.522611324],[28962e-11,2.64732254645,7.1135470008],[20844e-11,5.34138275149,.9803210682]],U=[[8721859e-11,1.07253635559,6283.0758499914],[99099e-10,3.14159265359,0],[294833e-11,.43717350256,12566.1516999828],[27338e-11,.05295636147,3.523118349],[16333e-11,5.18820215724,26.2983197998],[15745e-11,3.68504712183,155.4203994342],[9425e-11,.29667114694,18849.2275499742],[8938e-11,2.05706319592,77713.7714681205],[694e-10,.82691541038,775.522611324],[5061e-11,4.6624323168,1577.3435424478]],B=[[289058e-11,5.84173149732,6283.0758499914],[20712e-11,6.0498393902,12566.1516999828],[2962e-11,5.1956057957,155.4203994342],[2527e-11,3.14159265359,0],[1288e-11,4.7219761197,3.523118349]],G=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function N(z){let P=0;for(const[g,$,_]of L)P+=g*Math.cos($+_*z);let w=1;for(const g of[Y,U,B,G]){w*=z;for(const[$,_,b]of g)P+=$*w*Math.cos(_+b*z)}return P}return{earthL:N}})(),q.calendar=(function(){const{earthL:L}=q["vsop-earth"]||{},{createLru:Y}=q.lru||{},{bool:U}=q.bool||{},B=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],G=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],N=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function z(v){return(285+15*v)%360}function P(v,D,Z){const ie=Math.floor((14-D)/12),V=v+4800-ie,H=D+12*ie-3;return Z+Math.floor((153*H+2)/5)+365*V+Math.floor(V/4)-Math.floor(V/100)+Math.floor(V/400)-32045}function w(v){const D=v+32044,Z=Math.floor((4*D+3)/146097),ie=D-Math.floor(146097*Z/4),V=Math.floor((4*ie+3)/1461),H=ie-Math.floor(1461*V/4),W=Math.floor((5*H+2)/153);return{year:100*Z+V-4800+Math.floor(W/10),month:W+3-12*Math.floor(W/10),day:H-Math.floor((153*W+2)/5)+1}}function g(v,D){for(let Z=0;Z<60;Z++)if(Z%10===v&&Z%12===D)return Z;return-1}function $(v){const D=(v%60+60)%60;return{index:D,stem:B[D%10],branch:G[D%12],name:B[D%10]+G[D%12]}}function _(v){return((v+49)%60+60)%60}function b(v){const D=v-2451545,Z=D/36525,ie=D/365250;let V=L(ie)*180/Math.PI+180;V=(V%360+360)%360;const H=(5029.0966*Z+1.11113*Z*Z-6e-6*Z*Z*Z)/3600;V+=H,V-=.09033/3600;const W=(125.04452-1934.136261*Z)*Math.PI/180,le=(280.4665+36000.7698*Z)*Math.PI/180,oe=(218.3165+481267.8813*Z)*Math.PI/180,xe=(-17.2*Math.sin(W)-1.32*Math.sin(2*le)-.23*Math.sin(2*oe)+.21*Math.sin(2*W))/3600;V+=xe;const te=(357.52911+35999.05029*Z-1537e-7*Z*Z)*Math.PI/180,pe=.016708634-42037e-9*Z-1267e-10*Z*Z,Re=1.000001018*(1-pe*pe)/(1+pe*Math.cos(te+(1.914602-.004817*Z)*(Math.PI/180)*Math.sin(te)));return V-=20.4898/3600/(Re||1),(V%360+360)%360}function l(v){if(v<1900){const W=v;if(W<1600)return 120;if(W<1700){const oe=W-1600;return 120-.9808*oe-.01532*oe*oe+oe*oe*oe/7129}if(W<1800){const oe=W-1700;return 8.83+.1603*oe-.0059285*oe*oe+13336e-8*oe*oe*oe-oe**4/1174e3}if(W<1860){const oe=W-1800;return 13.72-.332447*oe+.0068612*oe*oe+.0041116*oe**3-37436e-8*oe**4+121272e-10*oe**5-1699e-10*oe**6+875e-12*oe**7}const le=W-1860;return 7.62+.5737*le-.251754*le*le+.01680668*le**3-.0004473624*le**4+le**5/233174}const D=[[1900,-2.8],[1920,21.2],[1940,24.3],[1950,29.1],[1960,33.2],[1970,40.2],[1980,50.5],[1990,56.9],[2e3,63.8],[2010,66.1],[2020,69.4],[2030,72],[2050,80],[2100,110]];if(v<=D[0][0])return D[0][1];for(let W=1;W<D.length;W++)if(v<=D[W][0]){const[le,oe]=D[W-1],[xe,te]=D[W];return oe+(te-oe)*(v-le)/(xe-le)}const[Z,ie]=D[D.length-1],V=(Z-1820)/100,H=(v-1820)/100;return ie+32*(H*H-V*V)}const d=8/24,u=7.7611/24,E=2425612+4/24;function S(v){return v<E?u:d}const m=Y({max:4096,name:"termInstant"}),y=1e-5,i=new Map,s=365.2422;function c(v,D){const Z=z(D),ie=P(v,1,5)-.5+D*15.2184,V=i.get(D);let H=V!==void 0?V+s:ie;Math.abs(H-ie)>20&&(H=ie);for(let le=0;le<12;le++){let oe=Z-b(H);if(oe=((oe+180)%360+360)%360-180,H+=oe/.98564736,Math.abs(oe)<y)break}i.set(D,H);const W=H-l(v)/86400;return W+S(W)}function f(v,D){const Z=v*24+D,ie=m.get(Z);if(ie!==void 0)return ie;const V=c(v,D);return m.set(Z,V),V}function j(v){const D=Math.floor(v+.5),Z=v+.5-D,ie=Math.min(1439,Math.floor(Math.round(Z*86400)/60)),{year:V,month:H,day:W}=w(D);return{year:V,month:H,day:W,hour:Math.floor(ie/60),minute:ie%60}}function T({year:v,month:D,day:Z,hour:ie=0,minute:V=0}){return P(v,D,Z)-.5+(ie*60+V)/1440}function x(v,D,Z){const ie=P(v,D,Z)-P(v,1,1)+1,V=2*Math.PI*(ie-81)/364;return 9.87*Math.sin(2*V)-7.53*Math.cos(V)-1.5*Math.sin(V)}const R=Y({max:8,name:"termWindow"}),M=Y({max:32,name:"termYear"}),me=Array.from({length:24},(v,D)=>D),we=me.filter(v=>v%2===0);function o(v,D){const Z=D?`${v}|jie`:`${v}|all`,ie=M.get(Z);if(ie)return ie;if(D){const H=M.get(`${v}|all`);if(H){const W=H.filter(le=>le.index%2===0);return M.set(Z,W),W}}const V=[];for(const H of D?we:me)V.push({year:v,index:H,name:N[H],jd:f(v,H)});return V.sort((H,W)=>H.jd-W.jd),M.set(Z,V),V}function O(v,D={}){const Z=U(D.jieOnly),ie=Z?`${v}|jie`:v,V=R.get(ie);if(V)return V;const H=[...o(v-1,Z),...o(v,Z),...o(v+1,Z)];return H.sort((W,le)=>W.jd-le.jd),R.set(ie,H),H}function F(v){if(typeof v!="string"||v.length<2)return[];const D=B.indexOf(v[0]),Z=G.indexOf(v[1]);if(D<0||Z<0)return[];const ie=g(D,Z);if(ie<0)return[];const V=Math.floor(ie/10)*10;return[G[(V+10)%12],G[(V+11)%12]]}function K(v,D){let Z=null;for(const ie of v)if(ie.index%2===0)if(ie.jd<=D)Z=ie;else break;return Z}function J(v,D){for(const Z of v)if(Z.index%2===0&&Z.jd>D)return Z;return null}function ne(v){const D=j(v),Z=ie=>String(ie).padStart(2,"0");return`${D.year}-${Z(D.month)}-${Z(D.day)} ${Z(D.hour)}:${Z(D.minute)}`}function re(){return[m.stats(),M.stats(),R.stats()]}return{STEMS:B,BRANCHES:G,TERM_NAMES:N,termLongitude:z,toJDN:P,fromJDN:w,sexagenaryIndex:g,ganzhiName:$,dayGanzhiIndex:_,sunLongitude:b,deltaTSeconds:l,OFFSET_MODERN:d,OFFSET_BEIJING_LOCAL:u,CUTOVER_JD:E,localOffsetFor:S,termInstantJd:f,jdToParts:j,partsToJd:T,equationOfTime:x,termWindow:O,xunKongOf:F,previousJie:K,nextJie:J,formatJd:ne,cacheMetrics:re}})(),q.lunar=(function(){const{toJDN:L,jdToParts:Y,termInstantJd:U,deltaTSeconds:B,localOffsetFor:G}=q.calendar||{},N=29.530588861,z=245155009766e-5,P=Math.PI/180;function w(l){const d=l/1236.85,u=z+N*l+15437e-8*d*d-15e-8*d*d*d+73e-11*d*d*d*d,E=1-.002516*d-74e-7*d*d,S=(2.5534+29.1053567*l-14e-7*d*d-11e-8*d*d*d)*P,m=(201.5643+385.81693528*l+.0107582*d*d+1238e-8*d*d*d-58e-9*d*d*d*d)*P,y=(160.7108+390.67050284*l-.0016118*d*d-227e-8*d*d*d+11e-9*d*d*d*d)*P,i=(124.7746-1.56375588*l+.0020672*d*d+215e-8*d*d*d)*P,s=-.4072*Math.sin(m)+.17241*E*Math.sin(S)+.01608*Math.sin(2*m)+.01039*Math.sin(2*y)+.00739*E*Math.sin(m-S)-.00514*E*Math.sin(m+S)+.00208*E*E*Math.sin(2*S)-.00111*Math.sin(m-2*y)-57e-5*Math.sin(m+2*y)+56e-5*E*Math.sin(2*m+S)-42e-5*Math.sin(3*m)+42e-5*E*Math.sin(S+2*y)+38e-5*E*Math.sin(S-2*y)-24e-5*E*Math.sin(2*m-S)-17e-5*Math.sin(i)-7e-5*Math.sin(m+2*S)+4e-5*Math.sin(2*m-2*y)+4e-5*Math.sin(3*S)+3e-5*Math.sin(m+S-2*y)+3e-5*Math.sin(2*m+2*y)-3e-5*Math.sin(m+S+2*y)+3e-5*Math.sin(m-S+2*y)-2e-5*Math.sin(m-S-2*y)-2e-5*Math.sin(3*m+S)+2e-5*Math.sin(4*m),c=u+s-B(2e3+d*100)/86400;return c+G(c)}function g(l){return Math.floor(l+.5)}function $(l){return Math.round((l+.5-z)/N)}function _(l,d,u){for(let E=l-1;E<=l+1;E++)for(let S=1;S<24;S+=2){const m=U(E,S),y=g(m);if(y>=d&&y<u)return{index:S,jd:m}}return null}function b(l,d,u){const E=L(l,d,u),S=g(U(l,23)),m=E<S?l-1:l,y=g(U(m,23));let i=$(y);for(;g(w(i))>y;)i--;for(;g(w(i+1))<=y;)i++;const s=g(U(m+1,23));let c=i;for(;g(w(c+1))<=s;)c++;const f=c-i;let j=-1;if(f===13)for(let R=1;R<=f;R++){const M=g(w(i+R-1)),me=g(w(i+R));if(!_(m,M,me)){j=R;break}}let T=11,x=!1;for(let R=1;R<=15;R++){const M=g(w(i+R-1)),me=g(w(i+R)),we=_(m,M,me),o=R===j;if(E>=M&&E<me){const O=Y(w(i+R-1)),F=o?(T+10)%12+1:T;return{year:m,lunarYear:x?m+1:m,month:F,day:E-M+1,isLeap:o,monthStart:`${O.year}-${String(O.month).padStart(2,"0")}-${String(O.day).padStart(2,"0")}`,hasZhongQi:!!we}}o||(T=T%12+1,T===1&&(x=!0))}throw new Error(`农历换算失败:${l}-${d}-${u}`)}return{SYNODIC:N,newMoonJd:w,dayNumberOf:g,solarToLunar:b}})(),q.geo=(function(){const{bool:L}=q.bool||{},Y=`
4
4
  北京 116.41 39.90;上海 121.47 31.23;天津 117.20 39.13;重庆 106.55 29.56