dsh-metaphysics 0.50.1 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1070 -957
- package/README.md +364 -353
- package/client.almanac.js +129 -0
- package/client.chart.js +167 -0
- package/client.chenggu.js +129 -0
- package/client.convert.js +129 -0
- package/client.daliuren.js +166 -0
- package/client.fengshui.js +128 -0
- package/client.js +667 -18497
- package/client.liuyao.js +166 -0
- package/client.mbti.js +129 -0
- package/client.name.js +129 -0
- package/client.numerology.js +129 -0
- package/client.qimen.js +166 -0
- package/client.star.js +129 -0
- package/client.tarot.js +166 -0
- package/client.xiaoliuren.js +129 -0
- package/client.zeri.js +129 -0
- package/docs/assets/dsh-metaphysics-group.jpg +0 -0
- package/docs/assets/verification-badge.svg +13 -0
- package/engine/almanac.js +4 -4
- package/engine/bazi.js +13 -2
- package/engine/classics.js +559 -546
- package/engine/diff.js +156 -6
- package/engine/fingerprint.js +76 -0
- package/engine/geju.js +475 -455
- package/engine/index.js +374 -8
- package/engine/interpret-knowledge.js +484 -484
- package/engine/interpret-plain.js +383 -380
- package/engine/interpret.js +1867 -1864
- package/engine/shensha.js +6 -3
- package/engine/trace.js +270 -0
- package/index.js +32 -3
- package/package.json +112 -106
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +8620 -7100
- package/docs/assets/dsh-metaphysics-group.png +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.fengshui.js",factory(Ln){const z={};return z.fail=(function(){return{fail:(G,Y)=>{const I=new Error(Y);return I.code=G,I}}})(),z.diff=(function(){const D=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools"]),G=i=>i!==null&&typeof i=="object";function Y(i,h,s="",g=[]){if(i===h)return g;if(!G(i)||!G(h))return g.push({path:s||"(root)",from:i,to:h}),g;const S=new Set([...Object.keys(i),...Object.keys(h)]);for(const b of S){if(D.has(b))continue;const $=s?`${s}.${b}`:b,q=i[b],F=h[b];G(q)&&G(F)?Y(q,F,$,g):JSON.stringify(q)!==JSON.stringify(F)&&g.push({path:$,from:q,to:F})}return g}const I=[[/^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\./,"输入回显"]],v=[[/^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\./,"爻"]],y=[[/^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 f(i){for(const[h,s]of I)if(h.test(i))return s;return C(i)||i}function C(i){for(const[h,s]of v)if(h.test(i))return s;return""}function l(i){for(const[h,s]of y)if(h.test(i))return s;return""}function M(i){return[...i].sort((h,s)=>h.path.localeCompare(s.path,"zh-Hans-CN",{numeric:!0}))}function N(i){if(!i.length)return"本盘不受此口径影响:所有字段一致。";const h=i.filter(b=>l(b.path)),s=[...new Set(i.map(b=>C(b.path)).filter(Boolean))],g=h.length?`根因 ${h.length} 处:`+h.slice(0,4).map(b=>`${f(b.path)} ${E(b.from)}→${E(b.to)}`).join("、")+(h.length>4?" 等":""):"无单一根因",S=s.length?`;连带影响 ${s.slice(0,6).join("、")}${s.length>6?" 等":""} ${s.length} 类,共 ${i.length} 处`:`;共 ${i.length} 处`;return g+S+"。"}const E=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 c(i,{title:h="",limit:s=12}={}){const g=[];if(h&&g.push(`【${h}】`),g.push(N(i)),!i.length)return g.join(`
|
|
2
|
+
`);const S=M(i.filter($=>l($.path))),b=M(i.filter($=>!l($.path)));if(S.length){g.push(""),g.push(" 根因(口径直接改动):");for(const $ of S)g.push(` ${f($.path).padEnd(6)} ${E($.from)} → ${E($.to)}`)}if(b.length){g.push(""),g.push(` 连带变化(${b.length} 处,展示前 ${Math.min(s,b.length)} 处):`);for(const $ of b.slice(0,s))g.push(` ${f($.path).padEnd(6)} ${E($.from)} → ${E($.to)}`);if(b.length>s){const $={};for(const q of b.slice(s)){const F=C(q.path)||"其他";$[F]=($[F]||0)+1}g.push(" 其余:"+Object.entries($).map(([q,F])=>`${q} ${F} 处`).join("、"))}}return g.join(`
|
|
3
|
+
`)}const j=(i,h,s,g,S,b)=>({key:i,title:h,short:s,read:$=>{const q=$[i]!==void 0?$[i]:$.schools&&$.schools[i];return b[q]?q:g},alt:$=>$===S?g:S,label:$=>b[$]||$}),A={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:i=>i.lateZi!==!1,alt:i=>!i,label:i=>i?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:i=>i.trueSolar!==!1,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=>i.trueSolar!==!1,alt:i=>!i,label:i=>i?"修正":"不修正"},j("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),j("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),j("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),j("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),j("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),j("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣",network:"网络"}),j("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),j("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),j("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"})],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"?"归次日":"归当日"}]};return{diffObjects:Y,labelOf:f,categoryOf:C,rootOf:l,sortDiffs:M,summarize:N,formatValue:E,renderDiff:c,CALIBER_SWITCHES:A}})(),z.fingerprint=(function(){const D="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function G(y){return JSON.stringify(Y(y))}function Y(y){if(y===null)return null;const f=typeof y;if(f==="string")return typeof y.normalize=="function"?y.normalize("NFC"):y;if(f==="number")return Number.isFinite(y)?Object.is(y,-0)?0:y:null;if(f==="boolean")return y;if(Array.isArray(y))return y.map(Y);if(f==="object"){const C={};for(const l of Object.keys(y).sort()){const M=y[l];M===void 0||typeof M=="function"||typeof M=="symbol"||(C[l]=Y(M))}return C}return null}function I(y){const f=String(y);let C=2166136261,l=2654435769;for(let E=0;E<f.length;E+=1){const c=f.charCodeAt(E);for(const j of[c&255,c>>>8])C=Math.imul(C^j,16777619),l=Math.imul(l^j,2246822507)}let M=(C>>>0)*8+(l>>>29),N="";for(let E=0;E<7;E+=1)N=D[M%32]+N,M=Math.floor(M/32);return N}function v(y={}){const f=String(y.system||""),C=String(y.version||"dev"),l=y.seed===void 0||y.seed===null||y.seed===""?null:Number(y.seed),M=y.asOf?String(y.asOf):null,N=y.params&&typeof y.params=="object"?y.params:{},E=G({system:f,params:N,seed:l,asOf:M}),c=G({base:E,version:C});return{id:`LY-${I(c)}`,baseId:`LY-${I(E)}`,version:C,system:f,payload:E}}return{canonicalJson:G,shortHash:I,fingerprintOf:v}})(),z.validate=(function(){const{fail:D}=z.fail||{},G=1600,Y=2400;function I(l){return l%4===0&&l%100!==0||l%400===0}function v(l,M){return M===2?I(l)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][M-1]||0}const y=l=>typeof l=="string"?`「${l}」`:String(l),f="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function C(l,M=""){const N=M?`${M} 的`:"";if(!l||typeof l!="object"||Array.isArray(l)){const A=l===null?"null":Array.isArray(l)?"数组":typeof l;throw D("E_INPUT",`${N}入参必须是对象(收到 ${A});${f}`)}const E=l.hour===void 0?0:l.hour,c=l.minute===void 0?0:l.minute;for(const[A,i]of[["year",l.year],["month",l.month],["day",l.day],["hour",E],["minute",c]])if(!Number.isInteger(i))throw D("E_INPUT",`${N}${A} 必须是整数(收到 ${y(i)});${f}`);if(l.year<G||l.year>Y)throw D("E_INPUT",`${N}year 超出支持范围 ${G}–${Y}(收到 ${l.year});更早的年份时区与历法口径不可靠`);if(l.month<1||l.month>12)throw D("E_INPUT",`${N}month 超出范围 1–12(收到 ${l.month})`);const j=v(l.year,l.month);if(l.day<1||l.day>j)throw D("E_INPUT",`${N}日期不存在:${l.year}-${l.month}-${l.day}(${l.year} 年 ${l.month} 月只有 ${j} 天)`);if(E<0||E>23)throw D("E_INPUT",`${N}hour 超出范围 0–23(收到 ${E})`);if(c<0||c>59)throw D("E_INPUT",`${N}minute 超出范围 0–59(收到 ${c})`);return l}return{MIN_YEAR:G,MAX_YEAR:Y,isLeapYear:I,daysInMonth:v,assertCivil:C}})(),z.lru=(function(){function D({max:G=64,ttlMs:Y=0,name:I="lru",now:v=()=>Date.now()}={}){const y=new Map,f={name:I,hits:0,misses:0,evictions:0,expirations:0},C=l=>Y>0&&v()-l.at>Y;return{name:I,max:G,ttlMs:Y,get(l){const M=y.get(l);if(!M||C(M)){M&&(y.delete(l),f.expirations+=1),f.misses+=1;return}return y.delete(l),y.set(l,M),f.hits+=1,M.value},set(l,M){for(y.has(l)&&y.delete(l),y.set(l,{value:M,at:v()});y.size>G;)y.delete(y.keys().next().value),f.evictions+=1;return M},has(l){const M=y.get(l);return M?C(M)?(y.delete(l),f.expirations+=1,!1):!0:!1},delete(l){return y.delete(l)},clear(){y.clear()},get size(){return y.size},stats(){const l=f.hits+f.misses;return{name:I,size:y.size,max:G,hits:f.hits,misses:f.misses,evictions:f.evictions,expirations:f.expirations,hitRate:l?f.hits/l:0}}}}return{createLru:D}})(),z.nayin=(function(){const D=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function G(Y){const I=(Number(Y)%60+60)%60,v=D[Math.floor(I/2)];return{name:v,element:v[2]}}return{NAYIN_NAMES:D,nayinOf:G}})(),z.sanhe=(function(){const D=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],G=Object.fromEntries(D.map(v=>[v.branches.join(""),v.element])),Y=Object.fromEntries(D.flatMap(v=>v.branches.map(y=>[y,v.element])));function I(v){return D.find(y=>y.branches.includes(v))||null}return{SANHE_GROUPS:D,SANHE:G,SANHE_ELEMENT:Y,sanheGroupOf:I}})(),z["vsop-earth"]=(function(){const D=[[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]],G=[[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]],Y=[[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]],I=[[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]],v=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function y(f){let C=0;for(const[M,N,E]of D)C+=M*Math.cos(N+E*f);let l=1;for(const M of[G,Y,I,v]){l*=f;for(const[N,E,c]of M)C+=N*l*Math.cos(E+c*f)}return C}return{earthL:y}})(),z.calendar=(function(){const{earthL:D}=z["vsop-earth"]||{},{createLru:G}=z.lru||{},Y=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],I=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],v=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function y(T){return(285+15*T)%360}function f(T,k,w){const R=Math.floor((14-k)/12),P=T+4800-R,J=k+12*R-3;return w+Math.floor((153*J+2)/5)+365*P+Math.floor(P/4)-Math.floor(P/100)+Math.floor(P/400)-32045}function C(T){const k=T+32044,w=Math.floor((4*k+3)/146097),R=k-Math.floor(146097*w/4),P=Math.floor((4*R+3)/1461),J=R-Math.floor(1461*P/4),V=Math.floor((5*J+2)/153);return{year:100*w+P-4800+Math.floor(V/10),month:V+3-12*Math.floor(V/10),day:J-Math.floor((153*V+2)/5)+1}}function l(T,k){for(let w=0;w<60;w++)if(w%10===T&&w%12===k)return w;return-1}function M(T){const k=(T%60+60)%60;return{index:k,stem:Y[k%10],branch:I[k%12],name:Y[k%10]+I[k%12]}}function N(T){return((T+49)%60+60)%60}function E(T){const k=T-2451545,w=k/36525,R=k/365250;let P=D(R)*180/Math.PI+180;P=(P%360+360)%360;const J=(5029.0966*w+1.11113*w*w-6e-6*w*w*w)/3600;P+=J,P-=.09033/3600;const V=(125.04452-1934.136261*w)*Math.PI/180,je=(280.4665+36000.7698*w)*Math.PI/180,r=(218.3165+481267.8813*w)*Math.PI/180,x=(-17.2*Math.sin(V)-1.32*Math.sin(2*je)-.23*Math.sin(2*r)+.21*Math.sin(2*V))/3600;P+=x;const L=(357.52911+35999.05029*w-1537e-7*w*w)*Math.PI/180,O=.016708634-42037e-9*w-1267e-10*w*w,X=1.000001018*(1-O*O)/(1+O*Math.cos(L+(1.914602-.004817*w)*(Math.PI/180)*Math.sin(L)));return P-=20.4898/3600/(X||1),(P%360+360)%360}function c(T){const k=[[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(T<=k[0][0])return k[0][1];for(let w=1;w<k.length;w++)if(T<=k[w][0]){const[R,P]=k[w-1],[J,V]=k[w];return P+(V-P)*(T-R)/(J-R)}return k[k.length-1][1]}const j=8/24,A=7.7611/24,i=2425612+4/24;function h(T){return T<i?A:j}const s=G({max:4096,name:"termInstant"}),g=1e-5,S=new Map,b=365.2422;function $(T,k){const w=y(k),R=f(T,1,5)-.5+k*15.2184,P=S.get(k);let J=P!==void 0?P+b:R;Math.abs(J-R)>20&&(J=R);for(let je=0;je<12;je++){let r=w-E(J);if(r=((r+180)%360+360)%360-180,J+=r/.98564736,Math.abs(r)<g)break}S.set(k,J);const V=J-c(T)/86400;return V+h(V)}function q(T,k){const w=T*24+k,R=s.get(w);if(R!==void 0)return R;const P=$(T,k);return s.set(w,P),P}function F(T){const k=Math.floor(T+.5),w=T+.5-k,R=Math.round(w*1440),{year:P,month:J,day:V}=C(k);return{year:P,month:J,day:V,hour:Math.floor(R/60)%24,minute:R%60}}function ce({year:T,month:k,day:w,hour:R=0,minute:P=0}){return f(T,k,w)-.5+(R*60+P)/1440}function ue(T,k,w){const R=f(T,k,w)-f(T,1,1)+1,P=2*Math.PI*(R-81)/364;return 9.87*Math.sin(2*P)-7.53*Math.cos(P)-1.5*Math.sin(P)}const pe=G({max:8,name:"termWindow"}),le=G({max:32,name:"termYear"}),be=Array.from({length:24},(T,k)=>k),Ee=be.filter(T=>T%2===0);function ke(T,k){const w=k?`${T}|jie`:`${T}|all`,R=le.get(w);if(R)return R;if(k){const J=le.get(`${T}|all`);if(J){const V=J.filter(je=>je.index%2===0);return le.set(w,V),V}}const P=[];for(const J of k?Ee:be)P.push({year:T,index:J,name:v[J],jd:q(T,J)});return P.sort((J,V)=>J.jd-V.jd),le.set(w,P),P}function de(T,k={}){const w=k.jieOnly===!0,R=w?`${T}|jie`:T,P=pe.get(R);if(P)return P;const J=[...ke(T-1,w),...ke(T,w),...ke(T+1,w)];return J.sort((V,je)=>V.jd-je.jd),pe.set(R,J),J}function ye(T){if(typeof T!="string"||T.length<2)return[];const k=Y.indexOf(T[0]),w=I.indexOf(T[1]);if(k<0||w<0)return[];const R=l(k,w);if(R<0)return[];const P=Math.floor(R/10)*10;return[I[(P+10)%12],I[(P+11)%12]]}function Ne(T,k){let w=null;for(const R of T)if(R.index%2===0)if(R.jd<=k)w=R;else break;return w}function Ie(T,k){for(const w of T)if(w.index%2===0&&w.jd>k)return w;return null}function Me(T){const k=F(T),w=R=>String(R).padStart(2,"0");return`${k.year}-${w(k.month)}-${w(k.day)} ${w(k.hour)}:${w(k.minute)}`}function Ae(){return[s.stats(),le.stats(),pe.stats()]}return{STEMS:Y,BRANCHES:I,TERM_NAMES:v,termLongitude:y,toJDN:f,fromJDN:C,sexagenaryIndex:l,ganzhiName:M,dayGanzhiIndex:N,sunLongitude:E,deltaTSeconds:c,OFFSET_MODERN:j,OFFSET_BEIJING_LOCAL:A,CUTOVER_JD:i,localOffsetFor:h,termInstantJd:q,jdToParts:F,partsToJd:ce,equationOfTime:ue,termWindow:de,xunKongOf:ye,previousJie:Ne,nextJie:Ie,formatJd:Me,cacheMetrics:Ae}})(),z.lunar=(function(){const{toJDN:D,jdToParts:G,termInstantJd:Y,deltaTSeconds:I,localOffsetFor:v,OFFSET_MODERN:y}=z.calendar||{},f=29.530588861,C=245155009766e-5,l=Math.PI/180;function M(h){const s=h/1236.85,g=C+f*h+15437e-8*s*s-15e-8*s*s*s+73e-11*s*s*s*s,S=1-.002516*s-74e-7*s*s,b=(2.5534+29.1053567*h-14e-7*s*s-11e-8*s*s*s)*l,$=(201.5643+385.81693528*h+.0107582*s*s+1238e-8*s*s*s-58e-9*s*s*s*s)*l,q=(160.7108+390.67050284*h-.0016118*s*s-227e-8*s*s*s+11e-9*s*s*s*s)*l,F=(124.7746-1.56375588*h+.0020672*s*s+215e-8*s*s*s)*l,ce=-.4072*Math.sin($)+.17241*S*Math.sin(b)+.01608*Math.sin(2*$)+.01039*Math.sin(2*q)+.00739*S*Math.sin($-b)-.00514*S*Math.sin($+b)+.00208*S*S*Math.sin(2*b)-.00111*Math.sin($-2*q)-57e-5*Math.sin($+2*q)+56e-5*S*Math.sin(2*$+b)-42e-5*Math.sin(3*$)+42e-5*S*Math.sin(b+2*q)+38e-5*S*Math.sin(b-2*q)-24e-5*S*Math.sin(2*$-b)-17e-5*Math.sin(F)-7e-5*Math.sin($+2*b)+4e-5*Math.sin(2*$-2*q)+4e-5*Math.sin(3*b)+3e-5*Math.sin($+b-2*q)+3e-5*Math.sin(2*$+2*q)-3e-5*Math.sin($+b+2*q)+3e-5*Math.sin($-b+2*q)-2e-5*Math.sin($-b-2*q)-2e-5*Math.sin(3*$+b)+2e-5*Math.sin(4*$),ue=g+ce-I(2e3+s*100)/86400;return ue+v(ue)}function N(h){return Math.floor(h+.5)}function E(h){const s=h-y;return s+v(s)}function c(h){return Math.round((h+.5-C)/f)}function j(h,s,g){for(let S=h-1;S<=h+1;S++)for(let b=1;b<24;b+=2){const $=E(Y(S,b)),q=N($);if(q>=s&&q<g)return{index:b,jd:$}}return null}function A(h,s,g){const S=D(h,s,g),b=N(E(Y(h,23))),$=S<b?h-1:h,q=N(E(Y($,23)));let F=c(q);for(;N(M(F))>q;)F--;for(;N(M(F+1))<=q;)F++;const ce=N(E(Y($+1,23)));let ue=F;for(;N(M(ue+1))<=ce;)ue++;const pe=ue-F;let le=-1;if(pe===13)for(let de=1;de<=pe;de++){const ye=N(M(F+de-1)),Ne=N(M(F+de));if(!j($,ye,Ne)){le=de;break}}let be=11,Ee=!1,ke=N(M(F));for(let de=1;de<=15;de++){const ye=N(M(F+de-1)),Ne=N(M(F+de)),Ie=j($,ye,Ne),Me=de===le;if(S>=ye&&S<Ne){const Ae=G(M(F+de-1)),T=Me?(be+10)%12+1:be;return{year:$,lunarYear:Ee?$+1:$,month:T,day:S-ye+1,isLeap:Me,monthStart:`${Ae.year}-${String(Ae.month).padStart(2,"0")}-${String(Ae.day).padStart(2,"0")}`,hasZhongQi:!!Ie}}Me||(be=be%12+1,be===1&&(Ee=!0)),ke=Ne}throw new Error(`农历换算失败:${h}-${s}-${g}`)}function i(h,s,g){return D(h,s,g)}return{SYNODIC:f,newMoonJd:M,dayNumberOf:N,solarToLunar:A,monthStartJd:i}})(),z.geo=(function(){const D=`
|
|
4
|
+
北京 116.41 39.90;上海 121.47 31.23;天津 117.20 39.13;重庆 106.55 29.56
|
|
5
|
+
广州 113.26 23.13;深圳 114.06 22.55;珠海 113.58 22.27;东莞 113.75 23.02;佛山 113.12 23.02
|
|
6
|
+
汕头 116.68 23.35;中山 113.39 22.52;惠州 114.42 23.11;江门 113.08 22.58;湛江 110.36 21.27
|
|
7
|
+
韶关 113.60 24.81;梅州 116.12 24.29;清远 113.05 23.70;肇庆 112.47 23.05;茂名 110.93 21.66
|
|
8
|
+
揭阳 116.37 23.55;潮州 116.62 23.66;汕尾 115.37 22.78;河源 114.70 23.74;阳江 111.98 21.86
|
|
9
|
+
杭州 120.15 30.28;宁波 121.55 29.88;温州 120.70 28.00;嘉兴 120.75 30.75;湖州 120.09 30.89
|
|
10
|
+
绍兴 120.58 30.05;金华 119.65 29.09;台州 121.42 28.66;舟山 122.10 30.00;衢州 118.87 28.94;丽水 119.92 28.45
|
|
11
|
+
南京 118.80 32.06;苏州 120.62 31.32;无锡 120.31 31.49;常州 119.97 31.81;南通 120.89 31.98
|
|
12
|
+
徐州 117.28 34.26;扬州 119.41 32.39;盐城 120.16 33.35;泰州 119.92 32.46;镇江 119.45 32.20
|
|
13
|
+
淮安 119.02 33.61;连云港 119.22 34.60;宿迁 118.28 33.96
|
|
14
|
+
合肥 117.23 31.82;芜湖 118.43 31.35;蚌埠 117.39 32.92;安庆 117.05 30.54;阜阳 115.81 32.90
|
|
15
|
+
大同 113.30 40.08;阳泉 113.58 37.86;长治 113.12 36.19;晋城 112.85 35.49;朔州 112.43 39.33
|
|
16
|
+
晋中 112.75 37.69;运城 111.00 35.02;忻州 112.73 38.42;临汾 111.52 36.09;吕梁 111.14 37.52
|
|
17
|
+
六安 116.50 31.75;马鞍山 118.50 31.67;淮南 117.00 32.63;滁州 118.32 32.30;黄山 118.34 29.71
|
|
18
|
+
福州 119.30 26.08;厦门 118.09 24.48;泉州 118.68 24.87;漳州 117.65 24.51;莆田 119.01 25.45
|
|
19
|
+
宁德 119.55 26.67;三明 117.64 26.26;南平 118.18 26.64;龙岩 117.02 25.08
|
|
20
|
+
南昌 115.86 28.68;赣州 114.93 25.83;九江 116.00 29.70;上饶 117.94 28.45;宜春 114.40 27.80
|
|
21
|
+
吉安 114.99 27.11;抚州 116.36 27.95;景德镇 117.18 29.27;萍乡 113.85 27.62;新余 114.93 27.82;鹰潭 117.07 28.26
|
|
22
|
+
济南 117.00 36.65;青岛 120.38 36.07;烟台 121.45 37.46;潍坊 119.16 36.70;临沂 118.35 35.05
|
|
23
|
+
济宁 116.59 35.41;淄博 118.05 36.82;威海 122.12 37.51;泰安 117.09 36.20;德州 116.36 37.44
|
|
24
|
+
聊城 115.98 36.45;菏泽 115.48 35.23;枣庄 117.32 34.81;日照 119.53 35.42;东营 118.50 37.43
|
|
25
|
+
滨州 117.97 37.38
|
|
26
|
+
郑州 113.62 34.75;洛阳 112.45 34.62;南阳 112.53 33.00;开封 114.31 34.80;新乡 113.93 35.30
|
|
27
|
+
安阳 114.35 36.10;商丘 115.65 34.44;信阳 114.09 32.15;周口 114.70 33.62;驻马店 114.02 33.00
|
|
28
|
+
平顶山 113.19 33.77;许昌 113.85 34.03;焦作 113.24 35.22;濮阳 115.03 35.76;漯河 114.03 33.58;三门峡 111.20 34.78
|
|
29
|
+
武汉 114.30 30.59;宜昌 111.29 30.69;襄阳 112.14 32.04;荆州 112.24 30.33;黄石 115.04 30.20
|
|
30
|
+
十堰 110.79 32.65;孝感 113.92 30.92;黄冈 114.87 30.45;咸宁 114.32 29.84;恩施 109.49 30.27
|
|
31
|
+
荆门 112.20 31.04;随州 113.38 31.72;鄂州 114.89 30.40
|
|
32
|
+
长沙 112.94 28.23;株洲 113.13 27.83;湘潭 112.94 27.83;衡阳 112.57 26.89;岳阳 113.13 29.36
|
|
33
|
+
常德 111.70 29.03;郴州 113.02 25.77;邵阳 111.47 27.24;益阳 112.36 28.55;永州 111.61 26.42
|
|
34
|
+
怀化 109.99 27.55;娄底 112.00 27.70;张家界 110.48 29.12
|
|
35
|
+
成都 104.07 30.67;绵阳 104.68 31.47;德阳 104.40 31.13;南充 106.08 30.80;宜宾 104.63 28.77
|
|
36
|
+
泸州 105.44 28.87;自贡 104.78 29.34;乐山 103.76 29.58;达州 107.50 31.21;内江 105.06 29.58
|
|
37
|
+
遂宁 105.57 30.53;眉山 103.85 30.05;广元 105.84 32.44;广安 106.63 30.46;攀枝花 101.72 26.58
|
|
38
|
+
雅安 103.00 29.98;巴中 106.75 31.87;资阳 104.63 30.12
|
|
39
|
+
贵阳 106.63 26.65;遵义 106.93 27.73;六盘水 104.83 26.60;安顺 105.93 26.25;毕节 105.29 27.30
|
|
40
|
+
铜仁 109.19 27.72;凯里 107.98 26.58;都匀 107.52 26.26
|
|
41
|
+
昆明 102.83 24.88;曲靖 103.80 25.49;玉溪 102.54 24.35;大理 100.23 25.60;丽江 100.23 26.86
|
|
42
|
+
保山 99.17 25.11;昭通 103.72 27.34;普洱 100.97 22.79;临沧 100.09 23.88;景洪 100.80 22.00
|
|
43
|
+
拉萨 91.13 29.65;日喀则 88.88 29.27;林芝 94.36 29.65;昌都 97.17 31.14
|
|
44
|
+
西安 108.94 34.34;咸阳 108.70 34.33;宝鸡 107.14 34.37;渭南 109.50 34.50;汉中 107.03 33.07
|
|
45
|
+
榆林 109.73 38.29;延安 109.49 36.60;安康 109.03 32.68;商洛 109.94 33.87;铜川 108.95 34.90
|
|
46
|
+
兰州 103.83 36.06;天水 105.72 34.58;白银 104.14 36.55;酒泉 98.49 39.73;张掖 100.45 38.93
|
|
47
|
+
武威 102.63 37.93;庆阳 107.64 35.71;平凉 106.67 35.54;定西 104.63 35.58;陇南 104.93 33.40
|
|
48
|
+
西宁 101.78 36.62;海东 102.10 36.50;格尔木 94.90 36.40
|
|
49
|
+
银川 106.23 38.49;石嘴山 106.38 39.02;吴忠 106.20 37.99;固原 106.24 36.02
|
|
50
|
+
乌鲁木齐 87.62 43.82;克拉玛依 84.89 45.58;喀什 75.99 39.47;伊宁 81.32 43.92;库尔勒 86.15 41.76
|
|
51
|
+
阿克苏 80.26 41.17;哈密 93.51 42.83;吐鲁番 89.19 42.95;石河子 86.04 44.31
|
|
52
|
+
呼和浩特 111.75 40.84;包头 109.84 40.66;鄂尔多斯 109.78 39.61;赤峰 118.89 42.26;通辽 122.24 43.65
|
|
53
|
+
呼伦贝尔 119.77 49.21;乌兰察布 113.13 40.99;巴彦淖尔 107.42 40.75
|
|
54
|
+
沈阳 123.43 41.80;大连 121.62 38.92;鞍山 122.99 41.11;抚顺 123.96 41.88;本溪 123.77 41.30
|
|
55
|
+
丹东 124.38 40.13;锦州 121.13 41.10;营口 122.24 40.67;阜新 121.67 42.02;辽阳 123.24 41.27
|
|
56
|
+
盘锦 122.07 41.12;铁岭 123.84 42.29;朝阳 120.45 41.57;葫芦岛 120.84 40.71
|
|
57
|
+
长春 125.32 43.82;吉林 126.55 43.84;四平 124.35 43.17;通化 125.94 41.73;白山 126.42 41.94
|
|
58
|
+
松原 124.82 45.14;白城 122.84 45.62;延吉 129.51 42.91
|
|
59
|
+
哈尔滨 126.53 45.80;齐齐哈尔 123.92 47.35;牡丹江 129.63 44.55;佳木斯 130.32 46.80;大庆 125.11 46.59
|
|
60
|
+
鸡西 130.97 45.30;双鸭山 131.16 46.65;伊春 128.84 47.73;鹤岗 130.30 47.35;黑河 127.53 50.24;绥化 126.97 46.65
|
|
61
|
+
南宁 108.37 22.82;柳州 109.42 24.33;桂林 110.29 25.27;梧州 111.28 23.48;北海 109.12 21.48
|
|
62
|
+
玉林 110.16 22.63;百色 106.62 23.90;河池 108.06 24.70;钦州 108.65 21.98;防城港 108.35 21.69
|
|
63
|
+
贵港 109.60 23.11;贺州 111.57 24.40;来宾 109.23 23.75;崇左 107.36 22.40
|
|
64
|
+
海口 110.20 20.04;三亚 109.51 18.25;儋州 109.58 19.52;琼海 110.47 19.26
|
|
65
|
+
香港 114.17 22.32;澳门 113.55 22.20;台北 121.52 25.03;高雄 120.31 22.63;台中 120.68 24.14
|
|
66
|
+
`,G={河北:"石家庄",山西:"太原",内蒙古:"呼和浩特",辽宁:"沈阳",吉林:"长春",黑龙江:"哈尔滨",江苏:"南京",浙江:"杭州",安徽:"合肥",福建:"福州",江西:"南昌",山东:"济南",河南:"郑州",湖北:"武汉",湖南:"长沙",广东:"广州",广西:"南宁",海南:"海口",四川:"成都",贵州:"贵阳",云南:"昆明",西藏:"拉萨",陕西:"西安",甘肃:"兰州",青海:"西宁",宁夏:"银川",新疆:"乌鲁木齐",台湾:"台北"},Y={石家庄:[114.51,38.04],太原:[112.55,37.87],沈阳:[123.43,41.8],长春:[125.32,43.82],哈尔滨:[126.53,45.8],南京:[118.8,32.06],杭州:[120.15,30.28],合肥:[117.23,31.82],福州:[119.3,26.08],南昌:[115.86,28.68],济南:[117,36.65],郑州:[113.62,34.75],武汉:[114.3,30.59],长沙:[112.94,28.23],广州:[113.26,23.13],南宁:[108.37,22.82],海口:[110.2,20.04],成都:[104.07,30.67],贵阳:[106.63,26.65],昆明:[102.83,24.88],拉萨:[91.13,29.65],西安:[108.94,34.34],兰州:[103.83,36.06],西宁:[101.78,36.62],银川:[106.23,38.49],乌鲁木齐:[87.62,43.82],台北:[121.52,25.03]},I=(()=>{const N={};for(const E of D.trim().split(`
|
|
67
|
+
`))for(const c of E.split(";")){const j=c.trim().split(/\s+/);if(j.length!==3)continue;const[A,i,h]=j;N[A]={lon:Number(i),lat:Number(h)}}for(const[E,[c,j]]of Object.entries(Y))N[E]||(N[E]={lon:c,lat:j});return N})(),v=/(省|市|地区|盟|自治州|自治县|自治区|特别行政区|县|区|镇|乡|街道|村|小区|社区)/g;function y(N){const E=String(N||"").trim();if(!E)return null;const c=Number(E);if(Number.isFinite(c)&&/^-?\d+(\.\d+)?$/.test(E)&&c>=60&&c<=150)return{lon:c,lat:null,matched:`${c}°E`,level:"经度",note:"按你输入的经度计算"};const j=E.replace(/\s/g,"").replace(v,""),A=Object.keys(I).sort((h,s)=>s.length-h.length);for(const h of A)if(j.includes(h)){const s=I[h];return{lon:s.lon,lat:s.lat,matched:h,level:"地级市",note:`按 ${h} 估算(约 ${s.lon}°E)`}}const i=E.replace(/\s/g,"");for(const[h,s]of Object.entries(G)){const g=i.indexOf(h);if(g<0)continue;const S=i.charAt(g+h.length);if(S==="区"||S==="县")continue;const b=I[s]||{lon:Y[s][0],lat:Y[s][1]};return{lon:b.lon,lat:b.lat,matched:s,level:"省会",note:`未匹配到具体城市,按 ${h} 省会 ${s} 估算(约 ${b.lon}°E)`}}return{lon:null,lat:null,matched:null,level:"未匹配",note:`没查到「${E}」,可改填经度(如 116.4)`}}const f=/(区|县|镇|乡|村|小区|街道|路|号|巷|弄|组|队)/,C="dsh-metaphysics/0.23.0 (+https://github.com/xuanfu-web/dsh-metaphysics)";async function l(N,{timeoutMs:E=2500}={}){if(typeof fetch!="function")return null;let c=null;try{const j=typeof AbortController=="function"?new AbortController:null;j&&(c=setTimeout(()=>j.abort(),E));const A="https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&accept-language=zh-CN&countrycodes=cn&q="+encodeURIComponent(N),i=await fetch(A,{signal:j?j.signal:void 0,headers:{"User-Agent":C}});if(!i||!i.ok)return null;const h=await i.json();if(!Array.isArray(h)||h.length===0)return null;const s=h[0],g=Number(s.lon),S=Number(s.lat);return Number.isFinite(g)?{lon:g,lat:S,matched:s.display_name,level:"在线",note:`在线解析:${s.display_name}`}:null}catch{return null}finally{c&&clearTimeout(c)}}async function M(N,E={}){const c=y(N),j=String(N||"").trim();if(!j||!(E.online===!0)||c&&typeof c.lon=="number"&&!f.test(j))return c;const i=await l(j,E);return i?{...i,local:c&&c.lon!=null?c:null}:c&&typeof c.lon=="number"?{...c,onlineFailed:!0,note:`${c.note}(联网解析失败或超时,已退回内置坐标表)`}:{...c,onlineFailed:!0}}return{CITIES:I,PROVINCES:G,resolveAddress:y,geocodeAddress:M}})(),z.random=(function(){function D(I){let v=Number(I)>>>0;return v||(v=2654435769),function(){v=v+1831565813>>>0;let f=v;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296}}function G(I){if(I==null||I==="")return Math.random;const v=Number(I);return Number.isFinite(v)?D(v):Math.random}function Y(I){return I==null||I===""?!0:Number.isFinite(Number(I))}return{mulberry32:D,randomOf:G,isSeed:Y}})(),z.dst=(function(){const{daysInMonth:D}=z.validate||{},G={1986:["1986-05-04","1986-09-14"],1987:["1987-04-12","1987-09-13"],1988:["1988-04-10","1988-09-11"],1989:["1989-04-16","1989-09-17"],1990:["1990-04-15","1990-09-16"],1991:["1991-04-14","1991-09-15"]},Y=(f,C,l)=>f*1e4+C*100+l;function I(f){const C=G[f.year];if(!C)return!1;const[l,M,N]=C[0].split("-").map(Number),[E,c,j]=C[1].split("-").map(Number),A=Y(f.year,f.month,f.day);if(A<Y(l,M,N)||A>Y(E,c,j))return!1;const i=f.hour*60+(f.minute||0);return!(A===Y(l,M,N)&&i<120||A===Y(E,c,j)&&i>=120)}function v(f){const C=f.minute||0;if(!I(f))return{year:f.year,month:f.month,day:f.day,hour:f.hour,minute:C,applied:!1,note:null};let{year:l,month:M,day:N,hour:E}=f;return E-=1,E<0&&(E+=24,N-=1,N<1&&(M-=1,M<1&&(M=12,l-=1),N=D(l,M))),{year:l,month:M,day:N,hour:E,minute:C,applied:!0,note:`检出自 ${G[f.year][0]} 至 ${G[f.year][1]} 的中国夏令时:出生钟面时间已减 1 小时校正`}}function y(f,C){const l=Array.isArray(f)?f.slice():[];return C&&C.applied&&C.note&&l.push(C.note),l}return{DST_SPANS:G,inDstSpan:I,applyDst:v,withDstNote:y}})(),z.fengshui=(function(){const{partsToJd:D,termInstantJd:G}=z.calendar||{},{applyDst:Y}=z.dst||{},{fail:I}=z.fail||{},v={1:{name:"一白",color:"白",element:"水",star:"贪狼",lucky:!0},2:{name:"二黑",color:"黑",element:"土",star:"巨门",lucky:!1},3:{name:"三碧",color:"碧",element:"木",star:"禄存",lucky:!1},4:{name:"四绿",color:"绿",element:"木",star:"文曲",lucky:!0},5:{name:"五黄",color:"黄",element:"土",star:"廉贞",lucky:!1},6:{name:"六白",color:"白",element:"金",star:"武曲",lucky:!0},7:{name:"七赤",color:"赤",element:"金",star:"破军",lucky:!1},8:{name:"八白",color:"白",element:"土",star:"左辅",lucky:!0},9:{name:"九紫",color:"紫",element:"火",star:"右弼",lucky:!0}},y={坎:"正北",艮:"东北",震:"正东",巽:"东南",离:"正南",坤:"西南",兑:"正西",乾:"西北"},f=["坎","艮","震","巽","离","坤","兑","乾"],C={乾:["六煞","天医","五鬼","祸害","绝命","延年","生气"],坎:["五鬼","天医","生气","延年","绝命","祸害","六煞"],艮:["六煞","绝命","祸害","生气","延年","天医","五鬼"],震:["延年","生气","祸害","绝命","五鬼","天医","六煞"],巽:["天医","五鬼","六煞","祸害","生气","绝命","延年"],离:["六煞","五鬼","绝命","延年","祸害","生气","天医"],坤:["天医","延年","绝命","生气","祸害","五鬼","六煞"],兑:["生气","祸害","延年","绝命","六煞","五鬼","天医"]},l=["生气","延年","天医","伏位"],M=["绝命","五鬼","六煞","祸害"],N=[{m:"壬",gua:"坎",deg:345},{m:"子",gua:"坎",deg:0},{m:"癸",gua:"坎",deg:15},{m:"丑",gua:"艮",deg:30},{m:"艮",gua:"艮",deg:45},{m:"寅",gua:"艮",deg:60},{m:"甲",gua:"震",deg:75},{m:"卯",gua:"震",deg:90},{m:"乙",gua:"震",deg:105},{m:"辰",gua:"巽",deg:120},{m:"巽",gua:"巽",deg:135},{m:"巳",gua:"巽",deg:150},{m:"丙",gua:"离",deg:165},{m:"午",gua:"离",deg:180},{m:"丁",gua:"离",deg:195},{m:"未",gua:"坤",deg:210},{m:"坤",gua:"坤",deg:225},{m:"申",gua:"坤",deg:240},{m:"庚",gua:"兑",deg:255},{m:"酉",gua:"兑",deg:270},{m:"辛",gua:"兑",deg:285},{m:"戌",gua:"乾",deg:300},{m:"乾",gua:"乾",deg:315},{m:"亥",gua:"乾",deg:330}],E=new Map(N.map((r,x)=>[r.m,x]));function c(r){const x=E.get(r);if(x===void 0)throw I("E_INPUT",`坐向必须是 24 山之一(${N.map(L=>L.m).join("")}),收到「${r}」——请按罗盘 24 山报坐或报向,不要自造方位词。`);return{...N[x],index:x}}function j(r){const L=(c(r).index+12)%24;return{...N[L],index:L}}const A=r=>["坎","离","震","巽"].includes(r)?"东四":"西四",i={生气:"大吉:最宜开门、主卧、灶口朝向",延年:"大吉:宜开门、主卧(利感情与人缘)",天医:"次吉:宜主卧、书房、老人房(利健康)",伏位:"次吉:宜卧室、神位(主平稳)",祸害:"小凶:宜厕所、储物间(宜静不宜动)",六煞:"次凶:宜厕所、储物间",五鬼:"大凶:宜厕所,或以灶坐压之(传统「火烧五鬼」说)",绝命:"最凶:宜灶坐压之、储物,忌门床"},h=["坎","坤","震","巽","中","乾","兑","艮","离"];function s(r,x){const L=(r%100+100)%100,O=r>=2e3?{male:99,female:3}:{male:100,female:4},X=oe=>{const me=(oe%9+9)%9;return me===0?9:me};let K=X(x==="male"?O.male-L:L-O.female);K===5&&(K=x==="male"?2:8);const H=h[K-1];if(H==="中")throw new Error("命卦计算异常:落中宫");return{num:K,gua:H,direction:y[H]}}function g(r){const x={伏位:{palace:r,direction:y[r]}},L=f.indexOf(r);for(let O=1;O<=7;O++){const X=f[(L+O)%8];x[C[r][O-1]]={palace:X,direction:y[X]}}return x}function S(r,x,L){return D({year:r,month:x,day:L,hour:12,minute:0})<G(r,2)?r-1:r}function b(r){const x=(1+(2026-r))%9;return x<=0?x+9:x}const $=["坎","坤","震","巽","中","乾","兑","艮","离"];function q(r){const x=b(r),L=[];for(const O of $){const K=(($.indexOf(O)+1-5+x-1)%9+9)%9+1,H=v[K];L.push({palace:O,direction:O==="中"?"中宫":y[O],num:K,name:H.name,star:H.star,element:H.element,lucky:H.lucky})}return{center:x,centerName:v[x].name,palaces:L}}const F=r=>String(r).padStart(2,"0");function ce(r){const x=Math.floor((r-1864)/20),L=(x%9+9)%9+1,O=1864+20*x;return{period:L,start:O,end:O+19,label:`${L}运(${O}–${O+19})`}}const ue=new Set(["乾","巽","艮","坤","甲","庚","壬","丙","寅","申","巳","亥"]),pe=["地元","天元","人元"],le={};N.forEach((r,x)=>{le[r.m]={...r,yuan:pe[x%3],yinYang:ue.has(r.m)?"阳":"阴"}});const be=["中","乾","兑","艮","离","坎","坤","震","巽"],Ee=["坎","坤","震","巽","中","乾","兑","艮","离"],ke={地元:0,天元:1,人元:2},de=r=>N.filter(x=>x.gua===r).map(x=>le[x.m]);function ye(r,x){const L={};for(let O=0;O<9;O++){const X=((r-1+(x?O:-O))%9+9)%9+1;L[be[O]]=X}return L}function Ne(r,x){if(x===5)return{forward:r.yinYang==="阳",basis:`五黄入中,按${r.m}本山${r.yuan}${r.yinYang}论`};const L=Ee[x-1],O=de(L)[ke[r.yuan]];return{forward:O.yinYang==="阳",basis:`${x}${L}宫取${r.yuan}${O.m}(${O.yinYang})`}}const Ie={1:[],2:[["乾","巽"],["亥","巳"],["丑","未"]],3:[["卯","酉"],["乙","辛"],["辰","戌"]],4:[["艮","坤"],["寅","申"],["甲","庚"]],5:[["子","午"],["癸","丁"],["卯","酉"],["乙","辛"],["丑","未"],["辰","戌"]],6:[["艮","坤"],["寅","申"],["甲","庚"]],7:[["卯","酉"],["乙","辛"],["辰","戌"]],8:[["乾","巽"],["亥","巳"],["丑","未"]],9:[]},Me=["三元九运(1864 年起一运、每运 20 年,九运 180 年一轮)","玄空下卦挨星(运盘顺飞;山盘/向盘以入中运星本宫同元龙阴阳定顺逆,五黄入中按本山阴阳)","二十四山旺山旺向通行表(每项含正反两向;一运、九运无局)"],Ae="玄空下卦为传统通行口径的本地排盘,属民俗参考,不构成现场勘舆结论,仅供娱乐;替卦/兼向、年月日时飞星与形峦不在本工具范围内。";function T(r,x,L){const O=le[x],X=le[L],K=ye(r,!0),H=K[O.gua],oe=K[X.gua],me=Ne(O,H),$e=Ne(X,oe),re=ye(H,me.forward),he=ye(oe,$e.forward),ee=$.map((ie,ge)=>({palace:ie,direction:ie==="中"?"中宫":y[ie],luoshu:ge+1,yun:K[ie],shan:re[ie],xiang:he[ie]})),ze=ie=>$.filter(ge=>ie[ge]===r),Te=Ie[r],we=Te.find(([ie,ge])=>O.m===ie&&X.m===ge||O.m===ge&&X.m===ie),xe=re[O.gua]===r&&he[X.gua]===r,Ce=xe&&we?"盘面与表法一致:本局到山到向。":xe?"盘面到山到向,但不在通行表法所列之局(表法与盘面口径不同,并列不合并)。":we?"通行表法列为旺山旺向,但本盘当运山星/向星未同时落坐向(表法与盘面口径不同,并列不合并)。":"本局既未到山到向,也不在表法旺山旺向之列。";return{palaces:ee,sitting:O,facing:X,yun:K,shan:re,xiang:he,yunCenter:r,shanCenter:{star:H,...me},xiangCenter:{star:oe,...$e},dangYun:{shan:ze(re),xiang:ze(he)},heshi:{shan:$.filter(ie=>re[ie]+K[ie]===10),xiang:$.filter(ie=>he[ie]+K[ie]===10)},wangShanWangXiang:{byChart:xe,byTable:!!we,table:Te.map(([ie,ge])=>`${ie}${ge}`),note:Ce}}}function k(r){const x=r.dst===!1?{year:r.year,month:r.month,day:r.day,hour:0,minute:0,applied:!1,note:null}:Y({year:r.year,month:r.month,day:r.day,hour:0,minute:0});return{year:x.year,month:x.month,day:x.day,dst:x}}const w=["大游年歌(八宅通行口径)","年家紫白飞星(纯公式:以 2026 丙午一白入中、逐年退一位、九年一轮;按立春换年)","24 山归属与度数(八宅通行口径,每山 15°)"],R="八宅与飞星为传统通行口径的本地计算,属民俗参考,不构成现场勘舆结论,仅供娱乐;实际户型以现场为准。";function P(r){if(r.action==="advise")return V(r);if(r.action==="xuankong")return je(r);const x=r.gender;if(x!=="male"&&x!=="female")throw I("E_INPUT","风水命卦需要性别:男女命卦算法不同,不可缺省");if(!Number.isInteger(r.year)||!Number.isInteger(r.month)||!Number.isInteger(r.day))throw I("E_INPUT","风水命卦需要完整出生年月日(公历)——只知道年份不够:命卦按立春界划分出生年");const L=k(r),O=S(L.year,L.month,L.day),{num:X,gua:K,direction:H}=s(O,x),oe=g(K),me=["坎","离","震","巽"].includes(K),$e=Number.isInteger(r.fortuneYear)?r.fortuneYear:null;return{system:"fengshui",meta:{birth:`${L.year}-${F(L.month)}-${F(L.day)}`,guaYear:O,gender:x==="male"?"男":"女",fortuneYear:$e,...L.dst.applied?{dst:L.dst.note}:{},...$e===null?{note:"未给流年:未算年紫白飞星(需要时补 fortuneYear)。"}:{},scope:"八宅命卦 + 大游年八星 + 年紫白;玄空飞星见 action=xuankong;不含形峦与现场勘舆。"},mingGua:{num:X,gua:K,direction:H,group:me?"东四命":"西四命",compatible:me?"宜东四宅(坐坎离震巽)":"宜西四宅(坐乾坤艮兑)"},luckyDirections:l.map(re=>({star:re,...oe[re]})),unluckyDirections:M.map(re=>({star:re,...oe[re]})),...$e===null?{}:{yearlyFlying:q($e)},sources:w,disclaimer:R}}function J(r){const x=typeof r.sitting=="string"&&r.sitting.trim()!=="",L=typeof r.facing=="string"&&r.facing.trim()!=="";if(!x&&!L)throw I("E_INPUT","缺少坐向:sitting(坐山)或 facing(向山)至少给一个——按罗盘 24 山报坐或报向,例如「坐北朝南」对应坐子向午");if(x&&L){const K=c(r.sitting.trim()),H=c(r.facing.trim());if((K.index+12)%24!==H.index)throw I("E_INPUT",`坐向不自洽:坐${K.m}(${K.deg}°)与向${H.m}(${H.deg}°)不是对宫(相差应 180°,实测 ${(H.deg-K.deg+360)%360}°)——请核对罗盘读数。`)}const O=x?c(r.sitting.trim()):j(r.facing.trim()),X=N[(O.index+12)%24];return{sitting:O,facing:X}}function V(r){const{sitting:x,facing:L}=J(r),O=x.gua,X=g(O),K=l.map(ee=>X[ee]),H=M.map(ee=>X[ee]),oe=ee=>`${ee.direction}(${ee.palace}宫)`,me=[...l,...M].map(ee=>({star:ee,lucky:l.includes(ee),...X[ee],role:i[ee]})),$e={door:`门宜开于吉方:首选生气方 ${oe(K[0])},次选延年方 ${oe(K[1])}、天医方 ${oe(K[2])}。`,stove:`灶宜「坐凶向吉」:灶身压凶方(首选绝命方 ${oe(H[0])}、五鬼方 ${oe(H[1])}),灶口朝吉方。`,bed:`主卧与床头宜安吉方:生气方 ${oe(K[0])} 或延年方 ${oe(K[1])};床头宜向吉方。`,toilet:`厕所宜压凶方:祸害方 ${oe(H[3])} 或六煞方 ${oe(H[2])}(污去凶气,宜静常闭)。`};let re=null;const he=Number.isInteger(r.year)&&Number.isInteger(r.month)&&Number.isInteger(r.day)&&(r.gender==="male"||r.gender==="female");if(he){const ee=k(r),ze=S(ee.year,ee.month,ee.day),Te=s(ze,r.gender),we=A(Te.gua),xe=A(O),Ce=we===xe,ie=l.map(ge=>`${ge}位${g(Te.gua)[ge].direction}`).join("、");re={birth:`${ee.year}-${F(ee.month)}-${F(ee.day)}`,guaYear:ze,gender:r.gender==="male"?"男":"女",mingGua:{gua:Te.gua,direction:Te.direction,group:`${we}命`},houseGua:{gua:O,group:`${xe}宅`},sameGroup:Ce,text:Ce?`命宅相配(${we}命住${xe}宅):以宅之八星盘布局即可,个人吉方与宅吉方大体同向。`:`命宅不配(${we}命住${xe}宅):传统调停法——门与床以命卦吉方为先(此命四吉方:${ie}),灶仍按宅卦坐凶向吉,两盘各自取用。`}}return{system:"fengshui",meta:{action:"advise",...he?{}:{birthNote:"未提供生辰:未做命宅配;如需按个人命卦调停门床,请补充出生年月日与性别。"},sitting:`${x.m}山(罗盘 ${x.deg}°)`,facing:`${L.m}山(罗盘 ${L.deg}°)`,houseGua:O,houseGroup:`${A(O)}宅`,scope:"门主灶厕走向按八宅通行口径给倾向,玄空飞星见 action=xuankong;不含形峦、不是现场勘舆结论。"},houseStars:me,layout:$e,...re?{mingMatch:re}:{},sources:w,disclaimer:R}}function je(r){const{sitting:x,facing:L}=J(r);let O,X=null,K;if(r.period!==void 0&&r.period!==null&&!Number.isInteger(r.period))throw I("E_INPUT",`运必须是 1–9 的整数(三元九运),收到「${r.period}」——一运 1864 起、九运 2024–2043。`);if(Number.isInteger(r.period)){if(r.period<1||r.period>9)throw I("E_INPUT",`运必须是 1–9 的整数(三元九运),收到「${r.period}」——一运 1864 起、九运 2024–2043。`);O=r.period}else Number.isInteger(r.fortuneYear)?(X=ce(r.fortuneYear),O=X.period):(O=9,K="未给运:默认按九运(2024–2043)排盘;可传 period(1–9)或 fortuneYear 指定。");const H=T(O,x.m,L.m),oe=le[x.m],me=le[L.m],$e=he=>({star:he.star,name:v[he.star].name,fly:he.forward?"顺飞":"逆飞",basis:he.basis}),re=he=>he.map(ee=>`${ee}宫${y[ee]}`).join("、")||"无";return{system:"fengshui",meta:{action:"xuankong",period:O,periodLabel:X?X.label:`${O}运`,...X?{year:r.fortuneYear,periodStart:X.start,periodEnd:X.end}:{},sitting:`${x.m}山(罗盘 ${x.deg}°)`,facing:`${L.m}山(罗盘 ${L.deg}°)`,sittingGua:x.gua,facingGua:L.gua,sittingYuan:`${oe.yuan}${oe.yinYang}`,facingYuan:`${me.yuan}${me.yinYang}`,shanCenter:$e(H.shanCenter),xiangCenter:$e(H.xiangCenter),...K?{note:K}:{},scope:"玄空下卦:运盘 + 山盘 + 向盘 + 当运星 + 合十 + 表法旺山旺向;不含替卦/兼向、不含年月日时飞星、不含形峦与现场勘舆。"},palaces:H.palaces,dangYun:{shan:{palaces:H.dangYun.shan,text:re(H.dangYun.shan)},xiang:{palaces:H.dangYun.xiang,text:re(H.dangYun.xiang)}},heshi:{shan:H.heshi.shan,xiang:H.heshi.xiang},wangShanWangXiang:H.wangShanWangXiang,sources:Me,disclaimer:Ae}}return{NINE_STARS:v,PALACE_DIRECTION:y,DAYOUTIAN:C,LUCKY_STARS:l,UNLUCKY_STARS:M,MOUNTAINS_24:N,mountainInfo:c,sittingFromFacing:j,STAR_LAYOUT_ROLE:i,mingGua:s,eightStars:g,guaYearOf:S,yearZibaiStar:b,yearlyFlying:q,periodOfYear:ce,MOUNTAIN_META:le,WANG_SHAN_WANG_XIANG:Ie,XUANKONG_SOURCES:Me,XUANKONG_DISCLAIMER:Ae,xuankongChart:T,buildFengshui:P}})(),z.followup=(function(){const{ZIWEI_STARS:D}=z["interpret-data"]||{},G=[{key:"career",label:"事业",words:["事业","工作","跳槽","升职","创业","职业","岗位","离职","加薪","面试","offer"]},{key:"wealth",label:"财富",words:["财","钱","收入","投资","买房","存款","亏","赚","分红"]},{key:"love",label:"感情",words:["感情","婚","恋","对象","分手","复合","姻缘","结婚","桃花"]},{key:"health",label:"健康",words:["健康","病","身体","手术","失眠","体检","医院"]},{key:"study",label:"学业",words:["学业","考试","学习","考研","考公","证书","升学"]},{key:"travel",label:"出行",words:["出行","搬家","旅行","出国","迁","远行"]}],Y={career:"官禄",wealth:"财帛",love:"夫妻",health:"疾厄",study:"官禄",travel:"迁移",overall:"命宫"},I=(c,j)=>{const A=String(c).match(/(20\d{2})\s*年?/);if(A)return Number(A[1]);const i=Array.isArray(j.liunian)&&j.liunian[0]?Number(j.liunian[0].year):null;return i?/明年/.test(c)?i+1:/后年/.test(c)?i+2:/去年/.test(c)?i-1:/今年|本年/.test(c)?i:null:null},v=c=>G.find(j=>j.words.some(A=>String(c).includes(A)))||null;function y(c,j){const A=I(j,c),i=v(j),h=Array.isArray(c.liunian)?c.liunian:[],s=Array.isArray(c.dayun?.list)?c.dayun.list:[],g=h.map(S=>S.year);if(A&&!h.some(S=>Number(S.year)===A))return{ok:!1,year:A,topic:i,answer:`这一盘已排的流年范围是 ${g[0]}–${g[g.length-1]},没有 ${A} 年。可以把问题改到范围内,或用 asOf 指定你想看的年份重新排盘。`,evidence:[`已排流年:${g.join("、")}`],confidence:"弱"};if(A){const S=h.find(ue=>Number(ue.year)===A),b=s.find(ue=>Number(ue.startAge)<=Number(S.age)&&Number(S.age)<=Number(ue.startAge)+9)||null,$=S.luck?.tier||"平",q=(S.luck?.reasons||[]).slice(0,3),F=(S.relations||[]).join("、"),ce=i?C(c,i.key):"";return{ok:!0,year:A,topic:i,answer:`${A} 年(${S.ganzhi})流年,十神为${S.stemTenGod||"—"},档位「${$}」;所行大运 ${b?`${b.ganzhi}(${b.luck?.tier||"平"})`:"未取到"}。${q.length?`理由:${q.join(",")}。`:""}${F?`与该年地支相关的原局关系:${F}。`:""}${ce}`,evidence:[`流年 ${S.year} ${S.ganzhi}·${S.stemTenGod||""}·${$}`,b?`大运 ${b.ganzhi}·${b.luck?.tier||"平"}`:"",F?`原局关系 ${F}`:"",i?`问题方向:${i.label}`:""].filter(Boolean),confidence:b&&q.length?"强":"中"}}if(i){const S={wealth:"overall",study:"work",travel:"overall"}[i.key]||i.key,b=(c.interpret?.dimensions||[]).find($=>$.key===i.key||$.key===S);if(b){const $=c.frame&&c.frame.godStats&&c.frame.godStats.groups||{},q=i.key==="wealth"?` 财星权重 ${Number($.财||0)}(只作结构参考,不含金额)。`:"";return{ok:!0,year:null,topic:i,answer:`按${i.label}这条线看:${b.text}${q}${b.advice?` 建议:${b.advice}`:""}`,evidence:(b.evidence||[]).slice(0,4),confidence:b.confidence||"中"}}}return{ok:!1,year:null,topic:i,answer:`这个问题里没有识别到具体的年份或方面。可以这样问:「2027 年事业怎么样」「财运如何」「感情在 2028 年」;已排流年是 ${g[0]}–${g[g.length-1]}。`,evidence:[`可问年份:${g.join("、")}`],confidence:"弱"}}function f(c,j){const A=I(j,c),i=v(j),h=Array.isArray(c.liunian)?c.liunian:[];if(A&&!h.some(s=>Number(s.year)===A))return{ok:!1,year:A,topic:i,answer:`这一盘的流年表覆盖 ${h[0]?.year}–${h[h.length-1]?.year},没有 ${A} 年;可以换一个年份,或用 asOf 指定起点重新排盘。`,evidence:[`流年表:${h.map(s=>s.year).join("、")}`],confidence:"弱"};if(A){const s=h.find(S=>Number(S.year)===A),g=s.daxian||{};return{ok:!0,year:A,topic:i,answer:`${A} 年(${s.ganzhi},${s.age} 岁)流年命宫落在「${s.lifePalace?s.lifePalace.palace:"—"}」,四化为 ${(s.mutagen||[]).join("、")||"不明显"};所行大限${g.palace?`在${g.palace}(${g.start}–${g.end} 岁)`:"未取到"}。${i?`与「${i.label}」对应的宫位信号见下条依据。`:""}`,evidence:[`流年命宫 ${s.lifePalace?s.lifePalace.palace:"—"}(${s.lifePalace?s.lifePalace.branch:"—"})`,`四化 ${(s.mutagen||[]).join("、")||"不明显"}`,g.palace?`大限 ${g.palace}·${g.start}–${g.end}岁`:""].filter(Boolean),confidence:(s.mutagen||[]).length>=3?"强":"中"}}if(i){const s=Y[i.key]||"命宫",g=(c.palaces||[]).find(S=>S.palace===s);if(g){const S=(g.stars||[]).filter($=>$.type==="主星").map($=>$.name),b=S.map($=>D[$]?.trait).filter(Boolean).slice(0,2).join(";");return{ok:!0,year:null,topic:i,answer:`「${i.label}」看${s}:主星${S.length?S.join("、"):"无正曜(借对宫)"}${b?`——${b}`:""}。宫支${g.branch},${g.stems,""}生年四化与煞星的影响需结合报告里的对应分节一起看。`,evidence:[`${s} ${g.branch}·${S.join("、")||"无正曜"}`,...(g.shensha||[]).slice(0,3)],confidence:S.length?"强":"弱"}}}return{ok:!1,year:null,topic:i,answer:"没有识别到具体年份或方面。可以问「2028 年事业」「感情怎么样」「财运在 2030 年」;也可以直接问某个宫位,如「夫妻宫」。",evidence:[],confidence:"弱"}}function C(c,j){return`这段时间可以重点对照报告里「${{career:"事业",wealth:"财富",love:"感情",health:"健康",study:"学业",travel:"出行"}[j]||"整体"}」一节看。`}function l(c,j){const A=v(j),i=Array.isArray(c.interpret?.sections)?c.interpret.sections:[],h=A?i.find(g=>g.label.includes(A.label)||g.text.includes(A.label)):null;if(h)return{ok:!0,year:null,topic:A,answer:h.text,evidence:[`引用分节:${h.label}`],confidence:"中"};const s=i[0];return{ok:!1,year:null,topic:A,answer:s?`这一盘的追问需要落到具体方面(事业 / 财富 / 感情 / 健康 / 学业 / 出行)。先看「${s.label}」这一节,或把问题说得更具体一点。`:"这一盘暂时没有可追问的分节;先看完整解析,再问具体方面。",evidence:[],confidence:"弱"}}function M(c,j){const A=String(j||"").trim(),i=c&&c.system==="bazi"?y(c,A):c&&c.system==="ziwei"?f(c,A):l(c,A);return{question:A,...i}}const N={bazi:"八字(四柱)",ziwei:"紫微斗数",liuyao:"六爻",meihua:"梅花易数",daliuren:"大六壬",qimen:"奇门遁甲",tarot:"塔罗",hepan:"合盘",chenggu:"称骨",almanac:"黄历",zeri:"择日",star:"星座",numerology:"生命数字",mbti:"十六型人格",trend:"人生 K 线",fengshui:"风水",name:"起名",convert:"公农历互转"};function E(c,j={}){const A=N[c&&c.system]||c&&c.system||"未知体系",h=String(j&&j.question||"").trim()||"请先用一句白话讲清这张盘的主线,再指出最值得注意的一两处,并说明每处的具体依据。",s=Number.isFinite(j&&j.maxChars)&&j.maxChars>=400?j.maxChars:3e3,g=String(c&&c.summary||"").trim(),S=g.length>s,b=S?`${g.slice(0,s)}…(摘要已截断)`:g,$=j&&typeof j.interpret=="object"&&j.interpret||c&&typeof c.interpret=="object"&&c.interpret||null,q=String($&&$.answer||"").trim(),F=String($&&$.plain||"").trim(),ce=[];q&&ce.push(`直答:${q}`),F&&ce.push(`说人话:${F}`);const pe=["【命理追问】下面这张盘是命理插件刚排好的,请就着它回答我的问题;不用重新排盘,盘面字段已经够用。",`体系:${A}`,`所问:${h}`,"",...ce.length?["——开场结论(插件已按同一套规则算好,开场先沿用这句;措辞可改,口径别换)——",...ce,""]:[],"——盘面摘要——",b||"(这张盘没有摘要字段,请先让我重新排一次。)","","——回答要求——","读者不懂命理。按下面的骨架答;任何一句他看不懂,就算没写完:",ce.length?"1) 开头一句结论:先沿用上面的「开场结论」,再用一句不用术语的话说清这张盘的主线——只读这一句也该有收获;":"1) 开头一句结论:不用术语,一句话说清这张盘的主线,只读这一句也该有收获;","2) 判断最多两条,按重要性排序,每条分四行写:"," 盘面|只引盘面已有的字(具体的柱、宫或爻、字段名),不掺解释;"," 白话|把上一行的术语当场翻成日常话——调候 / 化气 / 通关 / 空亡 / 争合 这类词必须落地,一个词只翻一次,不连续堆三个以上;"," 倾向|说「更可能……」,讲清它在现实里大概意味着什么,用概率语气;"," 边界|这条在什么情况下不成立;盘面没给的,直接写「这盘里看不出来」;","3) 收尾一句「如果只记一件事」:给一条能核对、能动手的观察点,并说明它出自上面哪条盘面依据;","4) 别把传统说法当成已证实的事实:不下绝对断言,也不用「肯定」「绝对」这类词,更不写「格局很好」「运程不顺」这种没有信息的空话。"].join(`
|
|
68
|
+
`);return{text:pe,question:h,system:c&&c.system||"",label:A,chars:pe.length,truncated:S}}return{followup:M,askPrompt:E}})(),z.index=(function(){const{buildBazi:D}=z.bazi||{},{buildLiuyao:G,tossLines:Y,bodyLabels:I,yongshenOf:v,yongshenStrength:y,fushenAccess:f,hexagramStrength:C,jinTuiPower:l,yingqiWindow:M}=z.liuyao||{},{buildZiwei:N,BRIGHTNESS:E,flowOf:c,asOfParts:j,ZIWEI_SCHOOL_DEFAULTS:A}=z.ziwei||{},{drawTarot:i}=z.tarot||{},{buildMeihua:h}=z.meihua||{},{buildDaliuren:s}=z.daliuren||{},{buildHepan:g}=z.hepan||{},{buildZiweiHepan:S}=z["ziwei-hepan"]||{},{buildQimen:b,buildSnapshot:$}=z.qimen||{},{geocodeAddress:q,resolveAddress:F}=z.geo||{},{toJDN:ce,ganzhiName:ue,dayGanzhiIndex:pe}=z.calendar||{},{randomOf:le,isSeed:be}=z.random||{},{interpret:Ee,DIRECTIONS:ke,DIRECTION_DEFAULT:de}=z.interpret||{},{followup:ye,askPrompt:Ne}=z.followup||{},{crossCheck:Ie,crossText:Me,crossSection:Ae}=z.crosscheck||{},{pastSignals:T,verifyFit:k}=z.verify||{},{rectifyBirth:w}=z.rectify||{},{buildAlmanac:R}=z.almanac||{},{buildZeri:P}=z.zeri||{},{buildChenggu:J}=z.chenggu||{},{buildXiaoliuren:V}=z.xiaoliuren||{},{buildStar:je}=z.star||{},{buildNumerology:r}=z.numerology||{},{buildMbti:x,mbtiPaper:L}=z.mbti||{},{buildConvert:O}=z.convert||{},{classicsFor:X,classicsText:K,suiyunClassicOf:H,classicOf:oe,CLASSIC_BOOKS:me}=z.classics||{},{diffObjects:$e,summarize:re,sortDiffs:he,labelOf:ee,rootOf:ze,categoryOf:Te,formatValue:we,CALIBER_SWITCHES:xe}=z.diff||{},{canonicalJson:Ce,fingerprintOf:ie}=z.fingerprint||{},{buildTrend:ge}=z.trend||{},{buildFengshui:Le}=z.fengshui||{},{buildName:Re}=z.name||{},{buildTrace:Ue,SYSTEM_LABEL:Xe}=z.trace||{},{fail:te}=z.fail||{},{assertCivil:Zn}=z.validate||{},Pn=e=>String(e).padStart(2,"0"),Ke=["male","female"];function Fe(e,o){return o===2?e%4===0&&e%100!==0||e%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][o-1]}function Oe(e,o=""){if(Ke.includes(e))return e;const n=e==null||e===""?"(未提供)":`「${e}」`;throw te("E_INPUT",`${o?o+"的":""}gender 必须是 male 或 female${n};性别决定大运/大限顺逆,不能靠默认值`)}const Qe=["brightnessSchool","gengYearSihua","tianmaSchool","tiankongSchool","jiekongSchool","kuiyueSchool","tianshiTianshang","changshengSchool","lateZishi"];function Be(e){const o={};for(const n of Qe)e[n]!==void 0&&(o[n]=e[n]);return e.schools&&typeof e.schools=="object"&&(o.schools=e.schools),o}function se(e){if(typeof e!="string"||!e.trim())throw te("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const o=e.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!o)throw te("E_INPUT",`无法解析 datetime:「${e}」,请用 1990-05-12T14:30 这种格式`);const n={year:Number(o[1]),month:Number(o[2]),day:Number(o[3]),hour:Number(o[4]??0),minute:Number(o[5]??0)};if(n.month<1||n.month>12)throw te("E_INPUT",`月份超出范围:${n.month}`);const t=Fe(n.year,n.month);if(n.day<1||n.day>t)throw te("E_INPUT",`日期不存在:${n.year}-${n.month}-${n.day}(${n.year} 年 ${n.month} 月只有 ${t} 天)`);if(n.hour>23||n.minute>59)throw te("E_INPUT",`时间超出范围:${n.hour}:${n.minute}`);if(n.year<1600||n.year>2400)throw te("E_RANGE",`年份 ${n.year} 超出可计算范围(1600–2400)`);return(n.year<1900||n.year>2100)&&(n.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${n.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),n}function Ve(e){const o=e.pillars,n=(U,ae)=>`${U}:${ae.ganzhi} ${ae.stemTenGod?`十神 ${ae.stemTenGod} `:""}藏干 ${ae.hidden.map(ve=>`${ve.stem}(${ve.tenGod})`).join(" ")} 纳音 ${ae.nayin} 地势 ${ae.dishi} 自坐 ${ae.zizuo} 空亡 ${ae.kongwang.join("")}`+(ae.shensha&&ae.shensha.length?` 神煞 ${ae.shensha.join("、")}`:""),t=Object.entries(e.wuxing).map(([U,ae])=>`${U}${ae}`).join(" "),a=e.palaces?`【胎元】${e.palaces.taiyuan.ganzhi} 命宫 ${e.palaces.minggong.ganzhi} 身宫 ${e.palaces.shengong.ganzhi}`:"",d=e.dayun.list.slice(0,8).map(U=>`${U.startAge}岁 ${U.ganzhi}(${U.stemTenGod})${U.luck?`·${U.luck.tier}`:""}${U.relations&&U.relations.length?`[${U.relations.join("")}]`:""}`).join(" "),u=e.dayun.jiao&&e.dayun.jiao.at?`;交运 ${e.dayun.jiao.at}(${e.dayun.jiao.frame},距${e.dayun.jiao.from.name} ${e.dayun.jiao.spanDays} 天,三日折一年)`:"",p=e.jieqi.nearBoundaryMinutes<20?`
|
|
69
|
+
⚠ 出生时刻距「节」仅 ${e.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`:"",Z={year:"年",month:"月",day:"日",hour:"时"},ne=e.shensha&&e.shensha.groups&&e.shensha.groups.length?`神煞(${e.shensha.count} 见):`+e.shensha.groups.map(U=>`${U.cat}|`+U.items.map(ae=>`${ae.name}(${ae.pillars.map(ve=>Z[ve]).join("")})`).join("、")).join(";"):"神煞:—",B=e.renyuan,W=oe("smt-renyuan"),m=B?`人元:${B.month}月第${B.day}日,${B.active}${B.activeElement}司权(${B.segments.map(U=>`${U.stem}${U.from}–${U.to}`).join(" ")})${B.beyond?";已过 30 日表,按本气算":""}${W?`|原文见《${me[W.book].name}·${W.chapter}》`:""}`:"",_=e.frame&&e.frame.yongshen&&e.frame.yongshen.disputed||[],Q=_.length?` 有争议:${_.map(U=>`${U.element}(${U.favorRole};${U.climate}盘调候忌${U.element})`).join("、")}`:"",fe=new Set(_.map(U=>U.element)),_e=e.frame?[`格局:${e.frame.primary?`${e.frame.primary.name}(${e.frame.primary.evidence})`:"—"}`,` ${e.frame.geju.map(U=>`${U.name}[${U.kind}]`).join(" ")}`,`用神:喜${e.frame.yongshen.favor.join("")}(${e.frame.yongshen.favorTenGods.join("、")}) 忌${e.frame.yongshen.avoid.join("")}(${e.frame.yongshen.avoidTenGods.join("、")})${Q} ${e.frame.yongshen.method}`,` ${e.frame.yongshen.detail}`,`寒暖:${e.climate?`${e.climate.label}(${(e.climate.evidence||[]).join("、")})${e.climate.need?` 调候取${e.climate.need.stem}${e.climate.need.element} 忌${e.climate.avoidElement}${fe.has(e.climate.avoidElement)?"(有争议)":""}`:""}`:"—"}`+(e.frame.yongshen.qt?` 穷通:${e.frame.yongshen.qt.month}${e.frame.yongshen.qt.stem}取${e.frame.yongshen.qt.yong.join("、")}(首取${e.frame.yongshen.qt.primary})`:""),`十神权重:${Object.entries(e.frame.godStats.groups).map(([U,ae])=>`${U}${ae}`).join(" ")}`]:[];return[`【四柱】${o.year.ganzhi} ${o.month.ganzhi} ${o.day.ganzhi} ${o.hour.ganzhi}`,`日主:${e.dayMaster.stem}${e.dayMaster.element}(${e.dayMaster.yinYang}) 空亡:${e.kongwang.join("")}`,n("年柱",o.year),n("月柱",o.month),n("日柱",o.day),n("时柱",o.hour),`五行:${t}`,...a?[a]:[],`日主强弱:${e.strength.level}(${e.strength.score}) ${e.strength.detail}`,..._e,`天干关系:${e.relations&&e.relations.stems.length?e.relations.stems.join(" "):"—"}`,`地支关系:${e.relations&&e.relations.branches.length?e.relations.branches.join(" "):"—"}`,ne,`真太阳时:${e.solarTime.trueSolarText}(${e.input.geo?e.input.geo.note+";":""}${e.solarTime.note}) 晚子时:${e.input.lateZi?"23:00 后算次日":"23:00 后仍算当日"}`,`节气:上一节 ${e.jieqi.previous.name} ${e.jieqi.previous.time} 下一节 ${e.jieqi.next.name} ${e.jieqi.next.time}`,...m?[m]:[],`大运:${e.dayun.rule}(${e.dayun.direction}),${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月起运${u}`,` ${d}`,`流年:${e.liunian.slice(0,10).map(U=>`${U.year}${U.ganzhi}(${U.stemTenGod})${U.luck?`·${U.luck.tier}`:""}`).join(" ")}`,(()=>{const U=e.liunian.filter(Se=>Se.suiyun&&Se.suiyun.signals&&Se.suiyun.signals.length);if(!U.length)return"岁运提示:近十年无岁运并临、运年反吟或大运/流年伏吟、反吟(只标干支,不判吉凶)";const ae=Se=>`${Se.type}${(Se.type.startsWith("流年")||Se.type.startsWith("大运"))&&Se.target?`(${Se.target})`:""}`,ve=H(e),Yn=ve?`|古籍见《${me[ve.book].name}·${ve.chapter}》`:"";return"岁运提示(只标干支变动,不判吉凶):"+U.map(Se=>`${Se.year}${Se.ganzhi} ${Se.suiyun.signals.map(ae).join("/")}`).join(";")+Yn})(),"(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)"].join(`
|
|
70
|
+
`)+p}function en(e){const o=e.lunar.monthRaw||e.lunar.month,n=`${e.lunar.year}年${e.lunar.isLeap?`闰${o}`:e.lunar.month}月${e.lunar.day}日`+(e.lunar.isLeap&&e.lunar.month!==o?`(按${e.lunar.month}月起盘)`:""),t=(()=>{if(!e.schools)return"";const _=Object.entries({brightnessSchool:"亮度",gengYearSihua:"庚干四化",tianmaSchool:"天马",tiankongSchool:"天空",jiekongSchool:"截空",kuiyueSchool:"魁钺",tianshiTianshang:"天伤天使",changshengSchool:"长生",lateZishi:"晚子时"}).filter(([Q])=>e.schools[Q]&&e.schools[Q]!==A[Q]).map(([Q,fe])=>`${fe} ${e.schools[Q]}`);return _.length?`【流派】${_.join(" ")}`:""})(),a=m=>m.length?m.map(_=>`${_.name}${_.mutagen?`化${_.mutagen}`:""}`).join(" "):"—",d=m=>`神煞:长生(${m.changsheng}) 博士(${m.boshi}) 将前(${m.jiangqian}) 岁前(${m.suiqi})`,u=[];for(const m of e.palaces){const _=m.isSoul?"【命】":m.isBody?"【身】":" ";u.push(` ${m.palace} ${m.branch} ${m.ganzhi} ${_} 大限${String(m.daxian.start).padStart(2)}-${m.daxian.end} 小限${String(m.xiaoxian.age).padStart(2)} ${a(m.stars)}`),u.push(` ${d(m.shensha)}`)}const p=(e.liunian??[]).slice(0,6).map(m=>` ${m.year} ${m.ganzhi} ${String(m.age).padStart(2)}岁 命宫${m.lifePalace.branch}(${m.lifePalace.palace}) 流禄${m.liulu} 流羊${m.liuyang} 流陀${m.liutuo} | ${m.mutagen.map(_=>_.replace("化","")).join(" ")}`+(m.mutagenHits?` 四化落宫 ${m.mutagenHits.map(_=>`${_.star}${_.type}→${_.palace||"未上盘"}`).join("、")}`:"")+(m.sanfangMainStars?` 三方主星 ${m.sanfangMainStars.join("")}`:"")),Z=(e.patterns??[]).length?e.patterns.map(m=>`${m.name}(${m.tone==="good"?"吉格":m.tone==="bad"?"忌格":"中"}:${m.evidence})`).join(";"):"无明显格局(按内置规则)",ne=(e.daxianList??[]).slice(0,8).map(m=>` ${m.branch}宫(${m.palace})${m.ages[0]}-${m.ages[1]}岁 ${m.ganzhi} 会${m.mainStars.join("")||"—"} 化 ${m.mutagenHits.map(_=>`${_.star}${_.type}→${_.palace||"未上盘"}`).join("、")}`),B=(()=>{const m=e.flyChains;if(!m)return"";const _=fe=>{const _e=m[fe];return!_e||!_e.steps.length?"":`${fe}:${_e.path.join("→")}${_e.closed?"(成环)":""}`},Q=["禄","权","科","忌"].map(_).filter(Boolean).join(" ");return Q?`【命宫飞星】${Q}`:""})(),W=(()=>{const m=e.flyComposite;if(!m||!Array.isArray(m.sources)||!m.sources.length)return"";const _=m.labels.length?m.labels.join(" · "):"无同宫会聚",Q=["禄","权","科","忌"].map(fe=>{const _e=(m.byType&&m.byType[fe]||[]).filter(ae=>!ae.self),U=[...new Set(_e.map(ae=>String(ae.to).replace(/宫$/,"")))];return U.length?`${fe}→${U.join("/")}`:""}).filter(Boolean).join(" ");return`【三方四正飞化】${m.sanfang.join("·")}:${_}${Q?` ${Q}`:""}`})();return[`【农历】${n}(月首 ${e.lunar.monthStart}) 时支:${e.hourBranch} 年干支:${e.yearGanzhi}`,`【时刻】${e.solarTime?`${e.solarTime.civilText} → 真太阳时 ${e.solarTime.trueSolarText}${e.input.geo?"("+e.input.geo.note+")":""}`:""}`,`【命宫】${e.soul.branch}(${e.soul.ganzhi}·${e.soul.nayin}) 【身宫】${e.body.branch}(落${e.body.lands}) 【五行局】${e.bureau.name}`,`【紫微】${e.ziwei} 【天府】${e.tianfu} 【命主】${e.lifeMaster} 【身主】${e.bodyMaster}`,`【大限】${e.daxian.rule},${e.daxian.startAge}岁起 【小限】${e.xiaoxianRule.direction}`,t,`【昌曲】文昌${e.changqu.wenchang.branch}(${e.changqu.wenchang.palace}${e.changqu.wenchang.mutagen?"·化"+e.changqu.wenchang.mutagen:""}) 文曲${e.changqu.wenqu.branch}(${e.changqu.wenqu.palace}${e.changqu.wenqu.mutagen?"·化"+e.changqu.wenqu.mutagen:""})`,` ${e.changqu.relation} 入命三方:${e.changqu.inSoulSanfang?"是":"否"} 吸收面:${e.changqu.absorb.label}(${e.changqu.absorb.reason})`,B,W,"十二宫:",...u,"大限(按起运年龄排序,前 8 限,宫干四化落宫):",...ne,"流年(前 6 年,完整 12 年在结构化数据里):",...p,`【格局】${Z}`,e.patternSummary?`【结构统计】吉格 ${e.patternSummary.good.length}、中性 ${e.patternSummary.neutral.length}、忌格 ${e.patternSummary.bad.length};${e.patternSummary.note}`:"",e.lunar.note?`注:${e.lunar.note}`:""].filter(Boolean).join(`
|
|
71
|
+
`)}const nn=["旺","相","休","囚","死"];function tn(e){const o=e.states,n=e.month;if(!o||!n)return"无月令数据";const t=a=>nn.filter(d=>a&&Array.isArray(a[d])&&a[d].length).map(d=>`${d} ${a[d].join("/")}`).join(" ");return`月令 ${n.branch}(${n.element}) 门 ${t(o.gate)||"—"} 星 ${t(o.star)||"—"} 干 ${t(o.stem)||"—"}`}function on(e){const o=e.palaces,n=t=>`${t.palace}宫 ${t.star||"—"}/${t.gate||"—"}/${t.god||"—"}${t.kong?" 空":""}${t.ma?" 马":""}`;return[`【四柱】${e.siZhu.year} ${e.siZhu.month} ${e.siZhu.day} ${e.siZhu.time}`,`【局数】${e.ju} 节气 ${e.jieqi}(${e.jieqiTime})`,`【值符】${e.zhiFu.star}(${e.zhiFu.gong}宫) 【值使】${e.zhiShi.gate}(${e.zhiShi.gong}宫) 旬首 ${e.xunshou}`,`【空亡】${e.kongWang.join("")||"—"} 驿马 ${e.ma.zhi||"—"}(${e.ma.gong||"—"}宫)`,`【宫位条件】击刑 ${(e.conditions&&e.conditions.jiXing||[]).map(t=>`${t.palace}宫${t.stem}`).join("、")||"无"} 入墓 ${(e.conditions&&e.conditions.ruMu||[]).map(t=>`${t.palace}宫${t.stem}`).join("、")||"无"}`,`【旺衰】${tn(e)}`,`【九宫】${o.map(n).join(" ")}`,`※ 晚子时:${e.lateZiHourMode==="next-day"?"23:00 后归次日":"23:00 后仍归当日"}(可用 lateZiHourMode / lateZi 指定)`,`※ ${e.rules[e.rules.length-1]}`].join(`
|
|
72
|
+
`)}function an(e){if(e.chart==="ziwei"){const t=a=>`${a.label}:${a.score>=0?"+":""}${a.score} ${a.text}`;return[`【紫微合盘】${e.score.level}(${e.score.total}/100)`,`你 命宫 ${e.a.soul.branch}(${e.a.soulStars.join("、")||"无主星"}) 夫妻 ${e.a.spouseStars.join("、")||"无主星"} ${e.a.bureau}`,`对方 命宫 ${e.b.soul.branch}(${e.b.soulStars.join("、")||"无主星"}) 夫妻 ${e.b.spouseStars.join("、")||"无主星"} ${e.b.bureau}`,...e.dimensions.map(t),...e.interactions.map(a=>` · ${a.text}`),...e.notes.map(a=>`※ ${a}`)].join(`
|
|
73
|
+
`)}const o=t=>`${t.label}:${t.score>=0?"+":""}${t.score} ${t.text}`,n=t=>!t||!t.solarNote?"—":`${t.longitude==null?"未含经度修正":`${t.longitude}°E`}(${t.solarNote})`;return[`【合盘】${e.score.level}(${e.score.total}/100)`,`你 ${e.a.pillars.join(" ")} 日主 ${e.a.dayMaster} 日支 ${e.a.dayBranch} ${e.a.strength||""}`,`对方 ${e.b.pillars.join(" ")} 日主 ${e.b.dayMaster} 日支 ${e.b.dayBranch} ${e.b.strength||""}`,`真太阳时:你 ${n(e.a)};对方 ${n(e.b)}`,...e.dimensions.map(o),...e.detail?[`属相:${e.detail.yearRelation.label}——${e.detail.yearRelation.text}`,`日干:${e.detail.stems.text}`,...e.detail.crossBranches&&e.detail.crossBranches.length?[`跨盘地支:${e.detail.crossBranches.map(t=>`${t.name}(${t.a}${t.b})`).join("、")}`]:[],`年命纳音:${e.detail.nayin.a} / ${e.detail.nayin.b}(${e.detail.nayin.label})——${e.detail.nayin.text}`,`吉凶象:吉 ${e.detail.tally.good} / 凶 ${e.detail.tally.bad}(${e.detail.tally.lean};分档只数象,总分以上面三维度为准)`]:[],...e.notes.map(t=>`※ ${t}`)].join(`
|
|
74
|
+
`)}function sn(e){const o=e.sanChuan,n=t=>`${t.zhi}(${t.jiang}${t.liuQin}${t.xunKong?"空":""})`;return[`【日时】${e.dayGanZhi}日 ${e.hourZhi}时(${e.dayNight}贵) 月将 ${e.yueJiang.name}${e.yueJiang.zhi} 节气 ${e.jieqi.name} ${e.lateZi===!1?"晚子时不换日":"晚子时换日"}`,`【三传】初 ${n(o.chu)} → 中 ${n(o.zhong)} → 末 ${n(o.mo)}`,`【四课】${e.siKe.map(t=>`${t.position}课 ${t.shang}上${t.xia}下(${t.relation}·${t.jiang})`).join(" ")}`,`【天地盘】${e.pan.map(t=>`${t.di}:${t.tian}(${t.jiang})`).join(" ")}`,`【格局】${e.geJu.name}·${e.geJu.detail}`,...e.shensha&&e.shensha.length?[`【神煞】${e.shensha.map(t=>`${t.name}${t.branch}`).join(" ")}`]:[]].join(`
|
|
75
|
+
`)}function rn(e){const o=[`【起卦】${e.source}`,`【本卦】${e.ben.name}(上${e.ben.upper} 下${e.ben.lower}) 动爻:${e.movingName}`,`【互卦】${e.hu.name} 【变卦】${e.bian.name} 【错卦】${e.cuo.name} 【综卦】${e.zong.name}`,`【体用】体 ${e.bodyUse.body.trigram}${e.bodyUse.body.element} 用 ${e.bodyUse.use.trigram}${e.bodyUse.use.element} ${e.bodyUse.level}`,` ${e.bodyUse.relation}`],n=e.lines.slice().reverse().map(t=>` ${t.name} ${t.yinYang==="阳"?"━━━━━":"━━ ━━"}${t.moving?" ←动":""}`);return[...o,"【爻】",...n].join(`
|
|
76
|
+
`)}function ln(e){const o=[e.question?`【所问】${e.question}`:"(未填写提问)",`【牌阵】${e.spread}${e.castAt?` 抽牌于 ${e.castAt}`:""}`];for(const n of e.cards)o.push(` ${n.position}:${n.name}(${n.orientation}) ${n.keywords.join("、")}`);if(e.reading&&e.reading.length){o.push("【解读】");for(const n of e.reading)o.push(` ${n}`)}return o.join(`
|
|
77
|
+
`)}function cn(e){const o=Z=>{const ne=Z.lines.slice().reverse().map(B=>{const W=B.position===Z.shi?"世":B.position===Z.ying?"应":" ";return` ${B.name} ${W} ${B.symbol} ${B.ganzhi}${B.element} ${B.liuqin}/${B.liushen}`});return[`${Z.name}(${Z.palace}·${Z.palaceElement})`,...ne].join(`
|
|
78
|
+
`)},n=[`起卦:${e.cast.notation.join("、")}(自下而上)`,`日辰:${e.dayGanZhi.name}`,e.xunShou?`旬首:${e.xunShou} 旬空:${(e.xunKong||[]).join("")||"—"}`:"",e.question?`所问:${e.question}`:"","本卦:",o(e.ben)];e.bian?n.push(`动爻:第 ${e.cast.movingPositions.join("、")} 爻`,"变卦(六亲以变卦自身宫论):",o(e.bian)):n.push("六爻安静,无变卦。");const t=e.body&&Array.isArray(e.body.labels)?e.body.labels:I(e.body);n.push(`卦体:${t.length?t.join(" · "):"无六冲、六合、伏吟、反吟"}`);const a=e.useGod||v(e,{});if(a&&a.liuqin){const Z=a.found.length?a.found.map(_=>`${_.position}爻${_.ganzhi}${_.element}${_.kong?"(空)":""}`).join("、"):a.fushen.length?a.fushen.map(_=>`伏 ${_.position}爻${_.ganzhi}${_.element}(${_.relation||"飞伏关系未知"})`).join("、"):"不上卦";n.push(`用神:${a.byShi?"世爻":a.liuqin}(${a.ask})→ ${Z}${a.side?`(${a.side})`:""}`);const ne=a.byShi?"用神 世爻":`用神 ${a.liuqin}`,B=a.labels.filter(_=>_!==ne&&!_.startsWith(ne));B.length&&n.push(`用神联动:${B.join(" · ")}`);const W=e.useGodStrength;if(W&&W.labels.length){const _=W.month&&W.month.branch?`月建 ${W.month.branch}(${W.month.element}) `:"";n.push(`用神旺衰:${_}${W.labels.join(" · ")}`)}const m=e.fushenAccess;m&&Array.isArray(m.labels)&&m.labels.length&&n.push(`伏神出伏:${m.labels.join(" · ")}`)}else n.push("用神:未取(未指明所问之事;用「询问方向」指定后即按六亲取用)");const d=e.hexStrength;if(d&&Array.isArray(d.labels)&&d.labels.length){const Z=d.month&&d.month.branch?`月建 ${d.month.branch}(${d.month.element}) `:"无月建(未给起卦时间) ";n.push(`全卦旺衰:${Z}${d.labels.join(" · ")}`)}const u=e.jinTuiPower;u&&Array.isArray(u.lines)&&u.lines.length&&n.push(`进退力重:${u.lines.map(Z=>`${Z.position}爻${Z.from}→${Z.to}${Z.type}·${Z.verdict}`).join(" · ")}`);const p=e.yingqi;return p&&Array.isArray(p.triggers)&&p.triggers.length&&n.push(`应期线索:${p.tempo} · ${p.triggers.map(Z=>`${Z.labels.join("/")}${Z.branch}`).join(" · ")}(只列地支,不出日期)`),n.filter(Boolean).join(`
|
|
79
|
+
`)}function un(e){const o=new WeakSet,n=(t,a)=>{switch((t instanceof Number||t instanceof String||t instanceof Boolean)&&(t=t.valueOf()),t&&typeof t=="object"&&typeof t.toJSON=="function"&&(t=t.toJSON(a)),typeof t){case"string":case"boolean":return t;case"number":return Number.isFinite(t)?Object.is(t,-0)?0:t:null;case"bigint":throw new TypeError("Do not know how to serialize a BigInt");case"object":{if(t===null)return null;if(o.has(t))throw new TypeError("Converting circular structure to JSON");o.add(t);let d;if(Array.isArray(t)){d=new Array(t.length);for(let u=0;u<t.length;u++){const p=n(t[u],String(u));d[u]=p===void 0?null:p}}else{d={};for(const u of Object.keys(t)){const p=n(t[u],u);p!==void 0&&(d[u]=p)}}return o.delete(t),d}default:return}};return n(e,"")}const dn=new Set(["shadow","shadowVersion","diff","trace","traceError","withInterpret","cross","verifyPast","rectify","events","geocode","ask","followup","caliber","seed","asOf"]),Ze=e=>{if(e==null||e==="")return null;const o=Number(e);return Number.isFinite(o)?Number(o.toFixed(6)):null};function Pe(e){if(e==null||e==="")return null;try{const o=se(e);return{y:o.year,m:o.month,d:o.day,h:o.hour,mi:o.minute,precision:o.precision}}catch{return String(e).trim()}}function Ge(e={}){const o={};return e.datetime&&(o.datetime=Pe(e.datetime)),e.gender&&(o.gender=String(e.gender).toLowerCase()),e.longitude!==void 0?o.longitude=Ze(e.longitude):e.address&&(o.address=String(e.address).trim()),e.lateZi!==void 0&&(o.lateZi=e.lateZi!==!1),e.trueSolar!==void 0&&(o.trueSolar=e.trueSolar!==!1),e.dst!==void 0&&(o.dst=e.dst!==!1),o}function mn(e){return e.lateZiHourMode==="next-day"||e.lateZi===!0?"next-day":"same-day"}function hn(e,o){const n=String(o&&o.system||e.system||""),t=o&&o.input&&typeof o.input=="object"?o.input:null;if(n==="bazi"&&t)return{civil:t.civil,gender:t.gender,longitude:Ze(t.longitude),lateZi:t.lateZi!==!1,trueSolar:t.trueSolar!==!1,dst:!!(t.dst&&t.dst.applied)};if(n==="ziwei"&&t)return{civil:{year:t.year,month:t.month,day:t.day,hour:t.hour,minute:t.minute},gender:t.gender,longitude:Ze(t.longitude),leapMonth:t.leapMonth||"split",leapAsNext:t.leapAsNext===!0,schools:t.schools||A,trueSolar:t.trueSolar!==!1,dst:!!(t.dst&&t.dst.applied)};if(n==="qimen")return{datetime:Pe(e.datetime),juMethod:e.juMethod||"chaibu",lateZiHourMode:mn(e)};if(n==="hepan")return{chart:e.chart==="ziwei"?"ziwei":"bazi",a:Ge({...e,datetime:e.datetime}),b:Ge(e.partner||{})};const a={};for(const[d,u]of Object.entries(e))if(!(dn.has(d)||u===void 0))if(d==="datetime")a.datetime=Pe(u);else if(d==="partner")a.partner=Ge(u);else if(d==="gender")a.gender=String(u).toLowerCase();else{if(d==="address")continue;typeof u=="number"?a[d]=Number.isFinite(u)?Object.is(u,-0)?0:u:null:typeof u=="string"?a[d]=u.trim():a[d]=u}return n==="daliuren"&&a.lateZi===void 0&&(a.lateZi=!0),n==="tarot"&&a.count===void 0&&(a.count=3),n==="meihua"&&a.mode===void 0&&(a.mode="time"),n==="xiaoliuren"&&a.mode===void 0&&(a.mode="time"),n==="convert"&&a.mode===void 0&&(a.mode="solar2lunar"),n==="fengshui"&&a.action===void 0&&(a.action="natal"),n==="tarot"&&o&&Array.isArray(o.cards)&&o.cards.length&&(a.cards=o.cards.map(d=>`${d.name||""}|${d.upright?"正":"逆"}`)),n==="liuyao"&&o&&o.cast&&Array.isArray(o.cast.lines)&&(a.cast=o.cast.lines.join("")),a}function fn(e,o){const n=o.seed,t=!(n==null||n==="");return e==="liuyao"&&Array.isArray(o.lines)&&o.lines.length===6?{reproducible:!0}:(e==="tarot"||e==="liuyao")&&!t?{reproducible:!1,reason:"未给 seed:重算会变成另一副牌 / 另一卦"}:e==="bazi"||e==="ziwei"||e==="trend"||e==="fengshui"?{reproducible:!0,asOfPinned:!!o.asOf}:{reproducible:!0}}function He(e={},o={}){const n=o.result||null,t=String(n&&n.system||e.system||""),a=String(o.version||typeof globalThis<"u"&&globalThis.__MP_VER||"dev");return{...ie({system:t,params:hn(e,n),seed:e.seed,asOf:e.asOf?String(e.asOf):null,version:a}),...fn(t,e),system:t,version:a}}const $n=new Set(["shadow","trace","traceError","interpret","summary","classics","suiyunClassic","renyuanClassic","cross","past","rectify","followup","caliber","input","reading","knowledge","outline","sections","answer","plain","tables","glossary","caveats","lead","dimensions","moduleType","technique","disclaimer","ask","followups","knowledgeCount","title","systemLabel"]);function Je(e){const o={};for(const[n,t]of Object.entries(e||{}))$n.has(n)||(o[n]=t);return o}function yn(e){return!e||!e.shadow||!e.shadow.baseId?null:{snapshot:!0,shadow:e.shadow,data:Je(e)}}function gn(e,o,n={}){const t=e&&e.shadow,a=o&&o.shadow;if(!t||!a)return{sameId:!1,total:0,reason:"缺少影子盘信息"};if(t.baseId&&a.baseId&&t.baseId!==a.baseId)return{sameId:!1,total:0,fromId:t.id,toId:a.id,fromBaseId:t.baseId,toBaseId:a.baseId,reason:"基础指纹不同,不是同一张盘"};const d=m=>m.snapshot===!0&&m.data&&typeof m.data=="object"?m.data:Je(m),u=$e(d(e),d(o)),p=he(u.filter(m=>ze(m.path))).map(m=>({path:m.path,label:ee(m.path),from:we(m.from),to:we(m.to)})),Z=new Map;for(const m of u){const _=Te(m.path)||"其他";Z.set(_,(Z.get(_)||0)+1)}const ne=[...Z.entries()].map(([m,_])=>({name:m,count:_})).sort((m,_)=>_.count-m.count||m.name.localeCompare(_.name,"zh-Hans-CN")),B=n.fromVersion||t.version||"",W=n.toVersion||a.version||"";return{sameId:!0,versionChanged:B!==W,fromVersion:B,toVersion:W,total:u.length,summary:re(u),roots:p,categories:ne,diffs:u}}function qe(e={}){const o=un(Nn(e));if(o&&o.system==="bazi"){o.classics=X(o);const n=K(o.classics);n&&(o.summary=`${o.summary}
|
|
80
|
+
【古籍】
|
|
81
|
+
${n}`);const t=H(o);if(t&&(o.suiyunClassic={...t,bookName:me[t.book].name}),o.renyuan){const a=oe("smt-renyuan");a&&(o.renyuanClassic={...a,bookName:me[a.book].name})}}if(o&&o.precision&&o.precision.level==="approx"&&o.summary&&(o.summary=`⚠ ${o.precision.note}
|
|
82
|
+
${o.summary}`),o&&(o.system==="bazi"||o.system==="ziwei")&&o.input&&o.input.longitude==null&&o.summary&&(o.summary=`⚠ 未提供出生地或经度:按东八区平太阳时排盘,时柱可能与本命盘相差一个时辰;海外出生请先把当地时间换算成东八区标准时。
|
|
83
|
+
${o.summary}`),e.withInterpret&&(o.interpret=Ee(o,{question:typeof e.question=="string"?e.question:"",direction:typeof e.direction=="string"?e.direction:"general"})),e.cross===!0&&(o.system==="bazi"||o.system==="ziwei")){const t={...se(e.datetime),gender:Oe(e.gender),longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1},a=Ye(e.asOf),d=o.system==="bazi"?N({...t,leapMonth:e.leapMonth,leapAsNext:e.leapAsNext===!0,...Be(e),asOf:a}):D({...t,lateZi:e.lateZi!==!1,nowYear:a?a.year:void 0});o.cross=Ie(o.system==="bazi"?o:d,o.system==="ziwei"?o:d),o.interpret&&o.interpret.sections.push(Ae(o.cross))}if(Number.isInteger(e.verifyPast)&&e.verifyPast>0&&o.system==="bazi"){const n=Math.min(Math.max(e.verifyPast,1),10),t=Number(o.liunianFrom)-n,a=D({...se(e.datetime),gender:Oe(e.gender),lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,dst:e.dst!==!1,nowYear:t});o.past={rows:T(a,Number(o.liunianFrom)-1),years:n,until:Number(o.liunianFrom)-1}}if(e.rectify===!0&&o.system==="bazi"){const n=se(e.datetime);o.rectify=w({base:{year:n.year,month:n.month,day:n.day,minute:n.minute},gender:Oe(e.gender),events:Array.isArray(e.events)?e.events:[],hours:Array.isArray(e.rectifyHours)?e.rectifyHours:void 0,lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0})}if(typeof e.ask=="string"&&e.ask.trim()&&(o.followup=ye(o,e.ask)),e.trace===!0)try{const n=Ue(o,{direction:e.direction,gender:e.gender});n&&(o.trace=n)}catch(n){o.traceError=String(n&&n.message||n)}if(e.shadow===!0)try{o.shadow=He(e,{result:o,version:e.shadowVersion})}catch(n){o.shadow={error:String(n&&n.message||n)}}return o}function We(e){if(!e)return"";const o=[`【${e.title||"解析与详解"}】${e.ask&&e.ask.echo?e.ask.echo:""}`];e.answer&&o.push(`▶ ${e.ask&&e.ask.question?"先答所问":"先看结论"}:${e.answer}`),e.plain&&o.push(`▶ 说人话:${e.plain}`),e.lead&&o.push(e.lead),Array.isArray(e.outline)&&e.outline.length&&o.push("一页读懂:"+e.outline.map(n=>`${n.label}·${n.text}`).join(" ")),e.error&&o.push(`⚠ 解析生成失败:${e.error}(上方盘面数据本身可用)`);for(const n of e.dimensions||[]){const t=Array.isArray(n.evidence)&&n.evidence.length?`
|
|
84
|
+
依据:${n.evidence.join(";")}${n.confidence?` 置信度:${n.confidence}`:""}`:"",a=n.plain?`(${n.plain})`:"",d=(n.knowledge||[]).map(u=>`
|
|
85
|
+
规则·${u.gist}〔${u.statusLabel}〕${u.detail} 出处:${u.source}${u.note?` 注:${u.note}`:""}`).join("");o.push(`${n.label}:${a}${n.text}${n.advice?` 建议:${n.advice}`:""}${t}${d}`)}for(const n of e.sections||[])o.push(`${n.label}:${n.text}`);for(const n of e.tables||[])!Array.isArray(n.rows)||!n.rows.length||(o.push(`【${n.title}】`),o.push([n.columns.join(" | "),...n.rows.map(t=>t.join(" | "))].join(`
|
|
86
|
+
`)));return Array.isArray(e.followups)&&e.followups.length&&o.push("还可以这样追问:"+e.followups.map(n=>`「${n}」`).join(" ")),Array.isArray(e.glossary)&&e.glossary.length&&o.push("名词解释:"+e.glossary.map(n=>`${n.term}=${n.plain}`).join(" ")),e.disclaimer&&o.push(e.disclaimer),o.join(`
|
|
87
|
+
`)}const pn=["cross","verifyPast","withInterpret","question","direction","ask","geocode","rectify","events","shadow","trace"];function bn(e={},o={}){const n=o.system||e.system,t=o.switches||xe[n]||[];if(!t.length)return{system:n,switches:[],affected:0,total:0};const a={...e};for(const u of pn)delete a[u];const d=t.map(u=>{const p=u.read(a),Z=u.alt(p);let ne=[],B="";try{ne=$e(qe({...a,[u.key]:p}),qe({...a,[u.key]:Z}))}catch(Q){B=Q&&Q.message||String(Q)}const W=he(ne.filter(Q=>ze(Q.path))).map(Q=>({path:Q.path,label:ee(Q.path),from:we(Q.from),to:we(Q.to)})),m=new Map;for(const Q of ne){const fe=Te(Q.path)||"其他";m.set(fe,(m.get(fe)||0)+1)}const _=[...m.entries()].map(([Q,fe])=>({name:Q,count:fe})).sort((Q,fe)=>fe.count-Q.count||Q.name.localeCompare(fe.name,"zh-Hans-CN"));return{key:u.key,title:u.title,short:u.short,current:p,alt:Z,currentLabel:u.label(p),altLabel:u.label(Z),total:ne.length,summary:B?"":re(ne),roots:W,categories:_,error:B}});return{system:n,switches:d,affected:d.filter(u=>!u.error&&u.total>0).length,total:d.reduce((u,p)=>u+p.total,0)}}const jn=["chaibu","chaoshen","zhirun"],wn=[1,3,5],Sn=["same-day","next-day"];function Ye(e){if(e==null||e==="")return;const o=j(e);if(!o)throw te("E_ASOF",`无法解析 asOf:「${e}」,请用 2026-10-22T16:00 这种格式`);const{year:n,month:t,day:a}=o;if(!(t>=1&&t<=12)||!(a>=1&&a<=Fe(n,t)))throw te("E_ASOF",`asOf 指向的日期不存在:${e}`);return o}function Nn(e={}){const o=e.system;if(o==="bazi"){const n=se(e.datetime),t=Ye(e.asOf),a=D({...n,gender:Oe(e.gender),longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,nowYear:t?t.year:void 0});return{...a,...t?{asOf:t}:{},precision:n.precision,summary:Ve(a)}}if(o==="ziwei"){const n=se(e.datetime),t=Ye(e.asOf),a=N({...n,gender:Oe(e.gender),leapMonth:e.leapMonth,leapAsNext:e.leapAsNext===!0,...Be(e),longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,trueSolar:e.trueSolar,dst:e.dst!==!1,asOf:t});return{...a,precision:n.precision,summary:en(a)}}if(o==="tarot"){const n=e.count===void 0||e.count===null||e.count===""?3:Number(e.count);if(!wn.includes(n))throw te("E_COUNT",`塔罗张数只能是 1 / 3 / 5,收到「${e.count}」`);if(!be(e.seed))throw te("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);const t=Ye(e.asOf),a=i({count:n,question:e.question,at:e.asOf,random:le(e.seed)});return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(a.seed=Number(e.seed)),{...a,...t?{asOf:t}:{},summary:ln(a)}}if(o==="daliuren"){const n=se(e.datetime),t=e.lateZi!==!1,a=s({...n,lateZi:t});return a.lateZi=t,{...a,precision:n.precision,summary:sn(a)}}if(o==="qimen"){const n=se(e.datetime);if(e.juMethod!==void 0&&!jn.includes(e.juMethod))throw te("E_INPUT",`juMethod 只能是 chaibu / chaoshen / zhirun,收到「${e.juMethod}」`);const t=e.lateZiHourMode!==void 0?e.lateZiHourMode:e.lateZi===!0?"next-day":e.lateZi===!1?"same-day":void 0;if(t!==void 0&&!Sn.includes(t))throw te("E_INPUT",`lateZiHourMode 只能是 same-day / next-day,收到「${t}」`);const a=t==="next-day"?"next-day":"same-day",d=b({...n,lateZiHourMode:a,juMethod:e.juMethod});return d.lateZiHourMode=a,{...d,summary:on(d)}}if(o==="hepan"){const n=e.partner;if(!n||typeof n!="object")throw te("E_PARTNER","合盘需要 partner:{ datetime, gender, address? },其中 partner.datetime 是对方的公历出生时间");if(!n.datetime)throw te("E_PARTNER",'缺少 partner.datetime(对方的公历出生时间),例如 partner: {"datetime":"1992-03-03T10:00","gender":"female"}');const t=se(e.datetime),a=se(n.datetime),d=e.chart==="ziwei"?"ziwei":"bazi",u={...t,gender:Oe(e.gender,"你(主方)"),trueSolar:e.trueSolar,lateZi:e.lateZi,dst:e.dst!==!1,address:typeof e.address=="string"?e.address:void 0,longitude:typeof e.longitude=="number"?e.longitude:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0},p={...a,gender:Oe(n.gender,"对方"),trueSolar:n.trueSolar,lateZi:n.lateZi,dst:n.dst!==!1,address:typeof n.address=="string"?n.address:void 0,longitude:typeof n.longitude=="number"?n.longitude:void 0,geo:n.geo&&typeof n.geo=="object"?n.geo:void 0},Z=d==="ziwei"?S({a:u,b:p}):g({a:u,b:p});return{...Z,summary:an(Z)}}if(o==="meihua"){let n;try{n=h({mode:e.mode==="number"?"number":"time",datetime:e.datetime,upper:e.upper,lower:e.lower,changing:e.changing})}catch(t){throw te("E_INPUT",`梅花起卦参数不完整:${t&&t.message?t.message:t}`)}return{...n,summary:rn(n)}}if(o==="liuyao"){if(!be(e.seed))throw te("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);let n;if(e.lines===void 0||e.lines===null)n=Y(le(e.seed));else{if(!Array.isArray(e.lines))throw te("E_LINES","lines 必须是数组:自下而上 6 个爻值(6 老阴 / 7 少阳 / 8 少阴 / 9 老阳)");if(e.lines.length!==6)throw te("E_LINES",`六爻需要正好 6 个爻值(自下而上),收到 ${e.lines.length} 个;留空则由引擎随机摇卦`);n=e.lines.map(Number)}let t,a=null;const d=e.datetime?se(e.datetime):Ye(e.asOf);if(d){e.datetime||(a=d);const W=ue(pe(ce(d.year,d.month,d.day)));t={stem:W.stem,branch:W.branch,name:W.name}}let u;try{u=G({lines:n,question:e.question,dayGanZhi:t})}catch(W){throw te("E_LINES",W&&W.message?W.message:W)}const p=v(u,{direction:e.direction,gender:e.gender});p.liuqin&&(u.useGod=p);let Z=null;if(d)try{Z=($({year:d.year,month:d.month,day:d.day,hour:d.hour,minute:d.minute}).monthGanZhi||"")[1]||null}catch{Z=null}const ne=C(u,{monthBranch:Z,dayBranch:u.dayGanZhi.branch});ne&&(u.hexStrength=ne);const B=l(u,{monthBranch:Z,dayBranch:u.dayGanZhi.branch});if(B&&(u.jinTuiPower=B),p.liuqin){const W=y(u,p,{monthBranch:Z,dayBranch:u.dayGanZhi.branch});W&&(u.useGodStrength=W);const m=f(u,p,{monthBranch:Z,dayBranch:u.dayGanZhi.branch});m&&(u.fushenAccess=m);const _=M(u,p,{monthBranch:Z});_&&(u.yingqi=_)}return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(u.seed=Number(e.seed)),{...u,...a?{asOf:a}:{},summary:cn(u)}}if(o==="almanac"){const n=se(e.datetime),t=R({year:n.year,month:n.month,day:n.day});return{...t,summary:Mn(t)}}if(o==="zeri"){if(typeof e.startDate!="string"||!e.startDate.trim())throw te("E_INPUT","择日需要 startDate(公历 YYYY-MM-DD,起算日);可另给 days(1–60,默认 30)与 shengXiao(当事人属相)");const n=P({task:e.task,startDate:e.startDate,days:e.days,shengXiao:e.shengXiao});return{...n,summary:An(n)}}if(o==="chenggu"){const n=se(e.datetime),t=/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime)),a=Number.isInteger(e.hour)?e.hour:t?n.hour:null;if(a===null||a<0||a>23)throw te("E_INPUT","称骨必须给时辰:datetime 带时分(如 1990-08-15T10:00),或额外给 hour(0–23)——缺时辰四柱不齐");const d=J({year:n.year,month:n.month,day:n.day,hour:a,minute:t?n.minute:0});return{...d,summary:Tn(d)}}if(o==="convert"){const n=e.mode==="lunar2solar"?"lunar2solar":"solar2lunar";let t;if(n==="lunar2solar"){if(e.lunarYear==null||e.lunarMonth==null||e.lunarDay==null)throw te("E_INPUT","农历转公历需要 lunarYear / lunarMonth / lunarDay(闰月另加 isLeapMonth: true)");t=O({mode:n,lunarYear:Number(e.lunarYear),lunarMonth:Number(e.lunarMonth),lunarDay:Number(e.lunarDay),isLeapMonth:e.isLeapMonth===!0})}else{const a=se(e.datetime);t=O({mode:n,year:a.year,month:a.month,day:a.day})}return{...t,summary:kn(t)}}if(o==="xiaoliuren"){const n=e.datetime?se(e.datetime):null,t=V({mode:e.mode==="number"?"number":"time",date:typeof e.date=="string"&&e.date.trim()?e.date:n?`${n.year}-${n.month}-${n.day}`:void 0,hour:Number.isInteger(e.hour)?e.hour:n&&/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime))?n.hour:void 0,num1:e.num1,num2:e.num2,num3:e.num3,question:e.question});return{...t,summary:xn(t)}}if(o==="star"){const n=se(e.datetime),t=je({year:n.year,month:n.month,day:n.day});return{...t,summary:En(t)}}if(o==="numerology"){const n=se(e.datetime),t=r({year:n.year,month:n.month,day:n.day});return{...t,summary:In(t)}}if(o==="mbti"){if(e.answers===void 0||e.answers===null){const t=L();return{...t,summary:zn(t)}}const n=x({answers:e.answers});return{...n,summary:On(n)}}if(o==="trend"){const n=se(e.datetime),t=ge({...n,gender:Oe(e.gender),toAge:e.toAge,lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0});return{...t,precision:n.precision,summary:_n(t)}}if(o==="fengshui"){const n=e.action==="advise"?"advise":e.action==="xuankong"?"xuankong":"natal";if(n==="xuankong"){const d=Le({action:n,sitting:e.sitting,facing:e.facing,...e.period!==void 0?{period:e.period}:{},...Number.isInteger(e.fortuneYear)?{fortuneYear:e.fortuneYear}:{}});return{...d,summary:De(d)}}if(n==="advise"){const d=Le({action:n,sitting:e.sitting,facing:e.facing,...e.datetime?se(e.datetime):{},...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},dst:e.dst!==!1});return{...d,summary:De(d)}}const t=se(e.datetime),a=Le({action:"natal",year:t.year,month:t.month,day:t.day,gender:Oe(e.gender),fortuneYear:Number.isInteger(e.fortuneYear)?e.fortuneYear:void 0,dst:e.dst!==!1});return{...a,summary:De(a)}}if(o==="name"){const n=e.action==="generate"?"generate":"assess",t=e.datetime?se(e.datetime):Number.isInteger(e.year)&&Number.isInteger(e.month)&&Number.isInteger(e.day)?{year:e.year,month:e.month,day:e.day,...Number.isInteger(e.hour)?{hour:e.hour}:{},...Number.isInteger(e.minute)?{minute:e.minute}:{}}:{},a=Re({action:n,surname:e.surname,givenName:e.givenName,limit:e.limit,charElements:e.charElements&&typeof e.charElements=="object"?e.charElements:void 0,strokeOverrides:e.strokeOverrides&&typeof e.strokeOverrides=="object"?e.strokeOverrides:void 0,surnameStrokes:e.surnameStrokes&&typeof e.surnameStrokes=="object"?e.surnameStrokes:void 0,...t,...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},...e.datetime?{lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0}:{}});return{...a,summary:vn(a)}}throw o?te("E_SYSTEM",`未知体系「${o}」,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、convert(公农历互转)。`):te("E_INPUT","缺少 system,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、convert(公农历互转)。")}function Mn(e){const o=e.ganzhi,n=e.jieQi&&e.jieQi.next?` 下一节:${e.jieQi.next.name} ${e.jieQi.next.date}`:"",t=e.dayGod?`值日:${e.dayGod.name}(${e.dayGod.type}·${e.dayGod.luck})`:"",a=e.xiu?`二十八宿:${e.xiu.name}宿(${e.xiu.luck}·${e.xiu.zheng}·${e.xiu.animal})`:"",d=e.taiShen?`胎神:${e.taiShen}`:"",u=e.positions?`吉神方位:喜神${e.positions.xiShen||"—"} 财神${e.positions.caiShen||"—"} 福神${e.positions.fuShen?e.positions.fuShen.dir:"—"} 阳贵${e.positions.yangGui?e.positions.yangGui.dir:"—"} 阴贵${e.positions.yinGui?e.positions.yinGui.dir:"—"}`:"",p=e.lucky?`吉配生肖:六合${e.lucky.liuhe||"—"} 三合${(e.lucky.sanhe||[]).join("、")||"—"}`:"",Z=e.nayin&&e.nayin.day?`日柱纳音:${e.nayin.day.name}`:"",ne=(e.hours||[]).map(B=>`${B.zhi}${B.ganZhi.slice(0,1)}·${B.shen}${B.luck==="吉"?"吉":"凶"}`).join(" ");return[`【黄历】${e.meta.date} ${e.meta.weekday} ${e.lunar.text}`,`干支:${o.year}年 ${o.month}月 ${o.day}日 属${o.shengXiao}`,...e.meta.boundaryNote?[` ${e.meta.boundaryNote}`]:[],`建除:${e.zhiXing}日 冲:${e.chong.text}${e.chong.sha?`(${e.chong.sha})`:""} ${t}`,[a,Z,d].filter(Boolean).join(" "),`宜:${e.yi.join("、")}`,`忌:${e.ji.join("、")}`,u,p,ne?`时辰吉凶:${ne}`:"",`节气:上一节 ${e.jieQi.prev?`${e.jieQi.prev.name} ${e.jieQi.prev.date}`:"—"}${n}`,e.dailyHexagram?`每日一卦:${e.dailyHexagram.name} ${e.dailyHexagram.meaning||""}`:"",`口径:${e.meta.scope}`].filter(Boolean).join(`
|
|
88
|
+
`)}function An(e){const o=`【择日·${e.meta.task}】${e.meta.startDate} 起 ${e.meta.days} 天${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`,n=e.days.slice().sort((t,a)=>a.score-t.score).slice(0,5).map(t=>`· ${t.date} ${t.weekday} ${t.verdict}(${t.score}分) 宜${t.yi.slice(0,3).join("/")} ${t.reasons.join(";")||"无特别加减分"}`);return[o,`推荐日:${e.best.length?e.best.join("、"):"本期无(都不够推荐分)"}`,`可用日:${e.usable.length?e.usable.join("、"):"无"}`,`回避日:${e.avoid.length?e.avoid.slice(0,6).join("、"):"无"}`,"逐日排序:",...n,`口径:${e.meta.scope}`].join(`
|
|
89
|
+
`)}function Tn(e){const o=e.song||{};return[`【称骨】${e.input.solar} ${e.lunar.text}`,`四项:${e.weights.year.label} ${e.weights.month.label} ${e.weights.day.label} ${e.weights.hour.label}`,`合计:${e.total.label}(${e.verdict.band})`,`歌诀(${e.total.label}):${o.text||"—"}`,`释义:${o.plain||"—"}`,`分档白话:${e.verdict.text}`,"口径:骨重与歌诀为通行本口径(各版本歌诀有异文),释义为白话自撰,属民俗娱乐参考。"].join(`
|
|
90
|
+
`)}function xn(e){return[`【小六壬·${e.meta.mode}】${e.meta.question?`所问:${e.meta.question}`:""}`,e.meta.originText,`落宫:${e.steps.join(" → ")}`,`断语:${e.result.palace}(${e.result.luck}) ${e.result.text}`].join(`
|
|
91
|
+
`)}function En(e){return[`【星座】${e.meta.date} ${e.sign.name}(${e.sign.element}·守护星${e.sign.planet})`,`区间:${e.sign.range} 关键词:${e.sign.keywords} 契合:${e.sign.compatible}`,`当日基调:${e.daily.tone}`,e.daily.dims.map(o=>`· ${o.name}:${"★".repeat(o.stars)}${"☆".repeat(5-o.stars)} ${o.text}`).join(`
|
|
92
|
+
`),`幸运色:${e.daily.luckyColor} 幸运数字:${e.daily.luckyNumber}`,"口径:当日基调由日期哈希确定性生成(同日同结果),纯娱乐向。"].join(`
|
|
93
|
+
`)}function kn(e){const o=e.ganzhi;return[`【公农历转换·${e.meta.mode==="lunar2solar"?"农历 → 公历":"公历 → 农历"}】${e.lunar.text} ⇄ ${e.solar.text} ${e.meta.weekday}`,`干支:${o.year}年 ${o.month}月 ${o.day}日 属${o.shengXiao}${o.springYear&&o.springYear!==o.year?`(春节界为${o.springYear}年)`:""}`,...e.meta.note?[`注:${e.meta.note}`]:[],`口径:${e.meta.scope}`].join(`
|
|
94
|
+
`)}function In(e){return[`【生命数字】${e.meta.date}(西方数字学,与八字/紫微不可互证)`,...e.parts.map(o=>`${o.name}:${o.number}(${o.meaning.title}) ${o.meaning.keywords}
|
|
95
|
+
倾向:${o.meaning.tendency}
|
|
96
|
+
课题:${o.meaning.lesson}`)].join(`
|
|
97
|
+
`)}function On(e){const o=e.dims.map(a=>{const d=a.picked===a.left?a.leftSay:a.rightSay,u=Math.round(a.pct*100);return`${a.left}/${a.right} 取 ${a.picked}(${a.strength} ${u}%,净分 ${a.sum}) ${d}`}),n=e.profile,t=Array.isArray(n.stack)&&n.stack.length?n.stack.map((a,d)=>`${d===0?"主导 ":""}${a.code}`).join(" → ")+`
|
|
98
|
+
${n.stack.map(a=>`${a.code}:${a.say}`).join(`
|
|
99
|
+
`)}`:"";return[`【十六型人格】${e.type}(${n.title})· ${n.keywords} 已答 ${e.answered}/${e.total} 题`,`一句:${n.oneLine}`,"【四维】",...o,`【优势】${n.strengths.join(";")}`,`【留意】${n.blindspots.join(";")}`,`【课题】${n.growth}`,`【认知功能】${t}`,`【工作】${n.work}`,`【关系】${n.love}`,`【学习】${n.study}`,`注:${e.note}`].join(`
|
|
100
|
+
`)}function zn(e){return[`【十六型人格问卷】${e.total} 题,每题按 1(完全不像我)到 5(很像我)打分`,...e.questions.map(o=>`${o.no}. ${o.text}`),`请把 ${e.total} 个分数按顺序交给 answers(如 [4,2,5,3,…]);可以跳过某些题(填 null),至少答 12 题。`,`注:${e.note}`].join(`
|
|
101
|
+
`)}function _n(e){const o=e.meta.strength,n=e.meta.dayMaster,t=n&&typeof n=="object"?`${n.stem}(${n.element})`:String(n||"");return[`【人生 K 线】${e.meta.birth} ${e.meta.gender} 日主 ${t} 旺衰 ${o.level}(${o.score})`,e.meta.boundaryNote?`※ ${e.meta.boundaryNote}`:"",`【大运分段】${e.segments.map(a=>`${a.ganZhi} ${a.startAge}-${a.endAge}岁`).join(" ")}`,`【走势】${Array.isArray(e.sparkline)?e.sparkline.join(" "):e.sparkline}`,...e.highlights&&e.highlights.best&&e.highlights.best.length?[`【关键年】最佳 ${e.highlights.best.join(";")}${e.highlights.worst&&e.highlights.worst.length?`
|
|
102
|
+
最需留意 ${e.highlights.worst.join(";")}`:""}`]:[],`※ ${e.disclaimer}`].filter(Boolean).join(`
|
|
103
|
+
`)}function De(e){if(e.meta.action==="xuankong"){const n=e.meta.period,t=u=>{const p=e.palaces.find(Z=>Z.palace===u);return`${u}${p.yun}/${p.shan}/${p.xiang}`},a=u=>u.map(t).join(" "),d=e.wangShanWangXiang;return[`【玄空】${e.meta.periodLabel} 坐 ${e.meta.sitting} 向 ${e.meta.facing}`,`【入中】山盘 ${e.meta.shanCenter.star}${e.meta.shanCenter.name}(${e.meta.shanCenter.fly},${e.meta.shanCenter.basis});向盘 ${e.meta.xiangCenter.star}${e.meta.xiangCenter.name}(${e.meta.xiangCenter.fly},${e.meta.xiangCenter.basis})`,`【九宫】${a(["巽","离","坤"])}|${a(["震","中","兑"])}|${a(["艮","坎","乾"])}`,`【当运】山星${n}到${e.dangYun.shan.text};向星${n}到${e.dangYun.xiang.text}`,`【表法】${d.table.length?d.table.join("、"):"无"};${d.note}`,`【合十】山星合十 ${e.heshi.shan.join("、")||"无"};向星合十 ${e.heshi.xiang.join("、")||"无"}`,...e.meta.note?[`※ ${e.meta.note}`]:[],`※ ${e.disclaimer}`].join(`
|
|
104
|
+
`)}if(e.meta.action==="advise"){const n=e.mingMatch?[`【命宅配】${e.mingMatch.text}`]:[`※ ${e.meta.birthNote||"未提供生辰,未做命宅配。"}`];return[`【宅卦】坐 ${e.meta.sitting} 向 ${e.meta.facing} ${e.meta.houseGua}宅(${e.meta.houseGroup})`,`【八星】${e.houseStars.map(t=>`${t.star}·${t.direction}${t.palace?`(${t.palace})`:""}`).join(" ")}`,`【门】${e.layout.door}`,`【灶】${e.layout.stove}`,`【床】${e.layout.bed}`,`【厕】${e.layout.toilet}`,...n,`※ ${e.disclaimer}`].join(`
|
|
105
|
+
`)}const o=e.mingGua;return[`【命卦】${o.num}${o.gua}(${o.group}) 方位 ${o.direction}`,`【四吉】${e.luckyDirections.map(n=>`${n.star}·${n.direction}${n.palace?`(${n.palace})`:""}`).join(" ")}`,`【四凶】${e.unluckyDirections.map(n=>`${n.star}·${n.direction}`).join(" ")}`,...e.yearlyFlying?[`【${e.meta.fortuneYear} 年九宫飞星】中宫 ${e.yearlyFlying.centerName};${e.yearlyFlying.palaces.filter(n=>n.palace!=="中").map(n=>`${n.palace}${n.name}`).join(" ")}`]:[`※ ${e.meta.note||""}`],`※ ${e.disclaimer}`].filter(Boolean).join(`
|
|
106
|
+
`)}function vn(e){if(e.action==="generate")return[`【候选名】姓 ${e.surname}(${e.gender},喜用 ${e.bazi.favorable.join("、")})${e.bazi.basis}`,...e.candidates.map(p=>{const Z=p.wuge&&p.wuge.available?` 五格 ${p.wuge.summary}`:"",ne=p.phonetics&&p.phonetics.available?` 音韵 ${p.phonetics.level}(${p.phonetics.tonePattern})`:"";return`${p.rank}. ${p.name} ${p.chars.map(B=>`${B.char}(${B.element})${B.meaning}`).join(" ")}${Z}${ne}`}),...e.notes.map(p=>`※ ${p}`)].join(`
|
|
107
|
+
`);const o=p=>p.source==="lib"?"字库":p.source==="user"?"用户指定":"未收录",n=p=>{const Z=p.element==="未收录"?"未收录(不猜五行)":`${p.element}(${o(p)})`,ne=p.favorable===!0?"合喜用":p.favorable===!1?"不合喜用":"不判",B=p.suggest&&p.suggest.length?` 可换:${p.suggest.map(W=>`${W.char}(${W.element})`).join("、")}`:"";return`· ${p.char}:${Z}|${ne}|${p.meaning}${B}`},t=e.wuge,a=t&&t.available?`【五格】${t.strokes.map(p=>`${p.char}${p.strokes}画`).join("+")}|${t.summary}|三才 ${t.sancai.text}`:`【五格】${t?t.reason:"未算"}`,d=e.phonetics,u=d&&d.available?`【音韵】${d.chars.map(p=>`${p.char}${p.py}${p.tone}`).join(" ")}|声调 ${d.tonePattern}|${d.level}${d.issues.length?`:${d.issues.map(p=>p.text).join(";")}`:""}`:`【音韵】${d?d.reason:"未算"}`;return[`【名字评估】${e.fullName}`,...e.chars.map(n),e.bazi?`【八字】日主 ${e.bazi.dayMaster&&e.bazi.dayMaster.stem?`${e.bazi.dayMaster.stem}(${e.bazi.dayMaster.element})`:e.bazi.dayMaster},旺衰 ${e.bazi.strength.level}(${e.bazi.strength.score}),${e.bazi.basis}`:"",a,u,`【结论】${e.verdict}`,...e.notes.map(p=>`※ ${p}`)].filter(Boolean).join(`
|
|
108
|
+
`)}function Cn(e){const n=[e.summary??JSON.stringify(e,null,2)];if(e.shadow&&e.shadow.id){const t=e.shadow;n.push(`【影子盘】${t.id}(同参数同 ID;版本 ${t.version})
|
|
109
|
+
基础指纹 ${t.baseId}(不含版本,跨版本可比对)`+(t.reproducible===!1?`
|
|
110
|
+
⚠ 不可复算:${t.reason}`:"")+(t.reproducible===!0&&t.asOfPinned===!1&&(t.system==="bazi"||t.system==="ziwei")?`
|
|
111
|
+
提示:未固定 asOf,流年/流月随「此刻」变化;要比对请传 asOf。`:""))}if(Array.isArray(e.trace)&&e.trace.length&&n.push(`【推导链】${Xe[e.system]||e.system} · ${e.trace.length} 层
|
|
112
|
+
`+e.trace.map((t,a)=>`${a+1}. ${t.field}|${t.result}
|
|
113
|
+
规则:${t.rule} 出处:${t.source}`).join(`
|
|
114
|
+
`)),e.interpret){const t=We(e.interpret);t&&n.push(t)}if(e.cross&&n.push(`【八字 × 紫微 交叉验证】
|
|
115
|
+
${Me(e.cross)}`),e.caliber&&Array.isArray(e.caliber.switches)&&e.caliber.switches.length){const t=e.caliber;n.push(`【口径对照】同一组输入,只换一个口径(不判哪套更准,也不改盘面)
|
|
116
|
+
`+t.switches.map(a=>a.error?`· ${a.title}:未能对照(${a.error})`:a.total?`· ${a.title}:${a.currentLabel} → ${a.altLabel}
|
|
117
|
+
${a.summary}`:`· ${a.title}:${a.currentLabel} → ${a.altLabel},本盘无变化`).join(`
|
|
118
|
+
`))}if(e.followup){const t=e.followup;n.push(`【追问】${t.question}
|
|
119
|
+
${t.answer}${t.evidence&&t.evidence.length?`
|
|
120
|
+
依据:${t.evidence.join(";")} 置信度:${t.confidence}`:""}`)}if(e.past&&Array.isArray(e.past.rows)&&e.past.rows.length&&n.push(`【验前事】过去 ${e.past.years} 年的流年信号(只读,不改盘)
|
|
121
|
+
`+e.past.rows.map(t=>`· ${t.year} ${t.ganzhi} · ${t.theme}(${t.tier}${t.tenGod?`,${t.tenGod}`:""})`).join(`
|
|
122
|
+
`)+`
|
|
123
|
+
用法:在面板里勾「准 / 不准 / 不确定」后算贴合度;贴合度低时先核对出生时间、时区与晚子时口径。`),e.rectify&&Array.isArray(e.rectify.candidates)){const t=e.rectify;n.push(`【生时校正】候选时辰 ${t.candidates.length} 个(固定规则打分,只缩小范围)
|
|
124
|
+
`+t.candidates.slice(0,8).map(a=>`· ${a.label} 时柱 ${a.hourGanzhi} / 日柱 ${a.dayGanzhi} · 命中 ${a.hits}/${a.total}`).join(`
|
|
125
|
+
`)+`
|
|
126
|
+
${t.note}`)}return n.filter(Boolean).join(`
|
|
127
|
+
|
|
128
|
+
`)}return{interpret:Ee,DIRECTIONS:ke,DIRECTION_DEFAULT:de,BRIGHTNESS:E,flowOf:c,geocodeAddress:q,resolveAddress:F,buildBazi:D,buildLiuyao:G,tossLines:Y,followup:ye,askPrompt:Ne,pastSignals:T,verifyFit:k,rectifyBirth:w,crossCheck:Ie,crossText:Me,crossSection:Ae,buildAlmanac:R,buildZeri:P,buildChenggu:J,buildXiaoliuren:V,buildStar:je,buildNumerology:r,buildConvert:O,buildTrend:ge,buildFengshui:Le,buildName:Re,buildTrace:Ue,parseDateTime:se,chartFingerprint:He,shadowSnapshot:yn,shadowDiff:gn,compute:qe,interpretText:We,caliberCompare:bn,renderText:Cn}})(),{Engine:z.index}}});
|