dsh-metaphysics 0.69.0 → 0.71.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.
@@ -1,6 +1,6 @@
1
- window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.constitution.js",factory(Mt){const R={};return R.fail=(function(){return{fail:(B,F)=>{const H=new Error(F);return H.code=B,H}}})(),R.bool=(function(){function P(s,c=!1){return s==null||s===""?c:s===!0||s===1||s==="true"||s==="1"?!0:s===!1||s===0||s==="false"||s==="0"?!1:c}const B={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},F={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function H(s,c){let u=s;const N=($,g)=>{Object.is(s[$],g)||(u===s&&(u={...s}),u[$]=g)},j=$=>{u===s&&(u={...s}),delete u[$]};for(const[$,g]of Object.entries(c))if(s[$]!==void 0){if(typeof s[$]=="string"&&s[$].trim()===""){j($);continue}N($,P(s[$],g))}return u}function Y(s){if(!s||typeof s!="object"||Array.isArray(s))return s;let c=s;for(const[u,N]of Object.entries(F)){if(s[u]===void 0)continue;if(typeof s[u]=="string"&&s[u].trim()===""){c===s&&(c={...s}),delete c[u];continue}const j=P(s[u],N);Object.is(s[u],j)||(c===s&&(c={...s}),c[u]=j)}return c}function q(s){if(!s||typeof s!="object")return s;let c=H(s,B);for(const u of["partner","partner2"]){const N=c[u],j=Y(N);j!==N&&(c===s&&(c={...s}),c[u]=j)}return c}const z=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],I=["lines","rectifyHours","answers"],k=["strokeOverrides","surnameStrokes"],m=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function f(s){if(typeof s!="string")return s;const c=s.trim();if(!m.test(c))return s;const u=Number(c);return Number.isFinite(u)?u:s}function _(s){let c=!1;const u={};for(const[N,j]of Object.entries(s)){const $=j===null?null:f(j);Object.is($,j)||(c=!0),u[N]=$}return c?u:s}function A(s){if(!s||typeof s!="object")return s;let c=s;const u=(N,j)=>{Object.is(s[N],j)||(c===s&&(c={...s}),c[N]=j)};for(const N of z)if(s[N]!==void 0){if(typeof s[N]=="string"&&s[N].trim()===""){c===s&&(c={...s}),delete c[N];continue}u(N,f(s[N]))}for(const N of I){const j=s[N];if(!Array.isArray(j))continue;let $=!1;const g=j.map(o=>{if(o===null)return null;if(typeof o=="string"&&o.trim()===""){$=!0;return}const h=f(o);return Object.is(h,o)||($=!0),h});$&&u(N,g)}for(const N of k){const j=s[N];!j||typeof j!="object"||Array.isArray(j)||u(N,_(j))}return c}return{bool:P,FLAG_DEFAULTS:B,canonicalFlags:q,NUMERIC_KEYS:z,NUMERIC_ARRAY_KEYS:I,NUMERIC_MAP_KEYS:k,canonicalNumbers:A}})(),R.diff=(function(){const{bool:P}=R.bool||{},B=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),F=o=>o!==null&&typeof o=="object";function H(o,h,d="",y=[]){if(o===h)return y;if(!F(o)||!F(h))return y.push({path:d||"(root)",from:o,to:h}),y;const x=new Set([...Object.keys(o),...Object.keys(h)]);for(const M of x){if(B.has(M))continue;const O=d?`${d}.${M}`:M,G=o[M],se=h[M];F(G)&&F(se)?H(G,se,O,y):JSON.stringify(G)!==JSON.stringify(se)&&y.push({path:O,from:G,to:se})}return y}const Y=[[/^pillars\.year\.ganzhi$/,"年柱"],[/^pillars\.month\.ganzhi$/,"月柱"],[/^pillars\.day\.ganzhi$/,"日柱"],[/^pillars\.hour\.ganzhi$/,"时柱"],[/^pillars\.\w+\.hidden/,"藏干"],[/^pillars\.\w+\.stemTenGod$/,"十神"],[/^pillars\.\w+\.kongwang/,"空亡"],[/^pillars\.\w+\.dishi$|^pillars\.\w+\.zizuo$/,"十二长生"],[/^pillars\.\w+\.nayin$/,"纳音"],[/^dayMaster\./,"日主"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\.(palace|branch|stem|ganzhi)$/,"宫位"],[/^palaces\.\d+\.stars\.\d+\.(name|brightness|type)$/,"星曜"],[/^palaces\.\d+\.shensha\./,"神煞"],[/^palaces\.\d+\.(daxian|xiaoxian)\./,"大限"],[/^palaces\.\d+\.sanfang\./,"三方四正"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\./,"命宫"],[/^body\./,"身宫"],[/^doujun\./,"流年斗君"],[/^siZhu\.year$/,"年柱"],[/^siZhu\.month$/,"月柱"],[/^siZhu\.day$/,"日柱"],[/^siZhu\.time$/,"时柱"],[/^ju$|^juNumber$/,"局数"],[/^yuan$/,"三元"],[/^dun$/,"阴阳遁"],[/^daxian(List)?\./,"大限"],[/^fly(Chains|Composite)?\./,"飞星"],[/^pattern/,"格局"],[/^schools\./,"流派回显"],[/^dayun\.jiao\./,"起运"],[/^dayun\.toNextJieDays$/,"起运时间"],[/^dayun\.list\.(\d+)\.ganzhi$/,"大运干支"],[/^dayun\.startAge(Exact)?\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],q=[[/^pillars\./,"四柱"],[/^shensha\./,"神煞"],[/^dayun\./,"大运"],[/^liunian\./,"流年"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^dayMaster\./,"日主"],[/^relations\./,"干支关系"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\.|^body\.|^doujun\./,"命身宫"],[/^siZhu\./,"四柱"],[/^ju$|^juNumber$|^yuan$|^dun$/,"局数"],[/^daxian/,"大限"],[/^fly/,"飞星"],[/^pattern/,"格局"],[/^jieqi\./,"节气"],[/^solarTime\./,"真太阳时"],[/^input\./,"输入回显"],[/^lines\./,"爻"]],z=[[/^pillars\.(year|month|day|hour)\.ganzhi$/,"柱"],[/^palaces\.(minggong|shengong)\.ganzhi$/,"命身宫"],[/^soul\.ganzhi$/,"命宫"],[/^body\.branch$/,"身宫"],[/^siZhu\.(year|month|day|time)$/,"柱"],[/^dayun\.jiao\.at$/,"起运"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^ju$|^juNumber$|^juName$/,"局数"],[/^dun$/,"阴阳遁"],[/^lines\.\d+\.(ganzhi|yinYang|name)$/,"爻"],[/^yueJiang\.(name|zhi)$/,"月将"]];function I(o){for(const[h,d]of Y)if(h.test(o))return d;return k(o)||o}function k(o){for(const[h,d]of q)if(h.test(o))return d;return""}function m(o){for(const[h,d]of z)if(h.test(o))return d;return""}function f(o){return[...o].sort((h,d)=>h.path.localeCompare(d.path,"zh-Hans-CN",{numeric:!0}))}function _(o){if(!o.length)return"本盘不受此口径影响:所有字段一致。";const h=o.filter(M=>m(M.path)),d=[...new Set(o.map(M=>k(M.path)).filter(Boolean))],y=h.length?`根因 ${h.length} 处:`+h.slice(0,4).map(M=>`${I(M.path)} ${A(M.from)}→${A(M.to)}`).join("、")+(h.length>4?" 等":""):"无单一根因",x=d.length?`;连带影响 ${d.slice(0,6).join("、")}${d.length>6?" 等":""} ${d.length} 类,共 ${o.length} 处`:`;共 ${o.length} 处`;return y+x+"。"}const A=o=>o===void 0?"—":o===null?"null":typeof o=="string"?o:Array.isArray(o)?o.join("")||"[]":typeof o=="object"?JSON.stringify(o):String(o);function s(o,{title:h="",limit:d=12}={}){const y=[];if(h&&y.push(`【${h}】`),y.push(_(o)),!o.length)return y.join(`
2
- `);const x=f(o.filter(O=>m(O.path))),M=f(o.filter(O=>!m(O.path)));if(x.length){y.push(""),y.push(" 根因(口径直接改动):");for(const O of x)y.push(` ${I(O.path).padEnd(6)} ${A(O.from)} → ${A(O.to)}`)}if(M.length){y.push(""),y.push(` 连带变化(${M.length} 处,展示前 ${Math.min(d,M.length)} 处):`);for(const O of M.slice(0,d))y.push(` ${I(O.path).padEnd(6)} ${A(O.from)} → ${A(O.to)}`);if(M.length>d){const O={};for(const G of M.slice(d)){const se=k(G.path)||"其他";O[se]=(O[se]||0)+1}y.push(" 其余:"+Object.entries(O).map(([G,se])=>`${G} ${se} 处`).join("、"))}}return y.join(`
3
- `)}const c=(o,h,d,y,x,M)=>({key:o,title:h,short:d,read:O=>{const G=O[o]!==void 0?O[o]:O.schools&&O.schools[o];return M[G]?G:y},alt:O=>O===x?y:x,label:O=>M[O]||O}),u={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:o=>P(o.lateZi,!0),alt:o=>!o,label:o=>o?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>P(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"}],ziwei:[{key:"leapMonth",title:"闰月归月:按日切分 / 整月归次月",short:"闰月归月",read:o=>o.leapMonth==="next"||o.leapMonth==="prev"?o.leapMonth:"split",alt:o=>o==="split"?"next":"split",label:o=>({split:"按日切分",next:"整月归次月",prev:"整月归本月"})[o]||o},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>P(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"},c("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),c("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),c("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),c("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),c("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),c("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣"}),c("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),c("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),c("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"}),c("shenzhuSchool","身主:子午皆火星 / 子铃午火","身主","common","verse",{common:"子午皆火星",verse:"子铃午火(安身主诀逐字)"}),c("mingzhuSchool","命主取法:命宫地支 / 生年年支","命主取法","soul-branch","year-branch",{"soul-branch":"命宫地支(通行本)","year-branch":"生年年支(中州派)"}),c("zuoyaoSchool","杂曜:49 颗简盘 / 61 颗全表","杂曜全表","minimal","full",{minimal:"49 颗(简盘)",full:"61 颗(加十二颗杂曜)"}),c("liunianSihua","流年四化取干:流年天干 / 流年命宫宫干","流年四化取干","year-stem","life-palace-stem",{"year-stem":"流年天干","life-palace-stem":"流年命宫宫干"}),c("sihuaVariant","十干四化:通行表 / 变体整表替换","十干四化变体","default","廉破曲阳",{default:"各干通行表",廉破曲阳:"甲干 廉破曲阳",贪阴阳机:"戊干 贪阴阳机",阳武同阴:"庚干 阳武同阴",阳武府同:"庚干 阳武府同",阳武府相:"庚干 阳武府相",阳武同相:"庚干 阳武同相",巨阳武昌:"辛干 巨阳武昌",梁紫府武:"壬干 梁紫府武",梁紫相武:"壬干 梁紫相武",破巨阳贪:"癸干 破巨阳贪"}),c("jieluSchool","截路空亡:照常 / 不排(中州派)","截路空亡","off","zhongzhou",{off:"照常(截空/副截/旬空/副旬)",zhongzhou:"不排(中州派)"}),c("suipoSchool","岁前十二神:照常 / 大耗改岁破(中州派)","岁前十二神","off","zhongzhou",{off:"照常(大耗)",zhongzhou:"大耗改岁破"})],qimen:[{key:"juMethod",title:"取局流派:拆补 / 超神接气 / 置闰",short:"取局流派",read:o=>["chaibu","chaoshen","zhirun"].includes(o.juMethod)?o.juMethod:"chaibu",alt:o=>o==="chaibu"?"zhirun":"chaibu",label:o=>({chaibu:"拆补法",chaoshen:"超神接气",zhirun:"置闰法"})[o]||o},{key:"lateZiHourMode",title:"晚子时:23:00 后归当日 / 次日",short:"晚子时归日",read:o=>o.lateZiHourMode==="next-day"?"next-day":"same-day",alt:o=>o==="next-day"?"same-day":"next-day",label:o=>o==="next-day"?"归次日":"归当日"}]},N={bazi:[{path:"pillars.day.ganzhi",label:"日柱"},{path:"pillars.hour.ganzhi",label:"时柱"},{path:"strength.level",label:"旺衰"},{path:"frame.primaryName",label:"格局"},{path:"frame.yongshen.favor",label:"喜用"},{path:"dayun.jiao.at",label:"起运"}],ziwei:[{path:"soul.ganzhi",label:"命宫"},{path:"body.branch",label:"身宫支"},{path:"bureau.name",label:"五行局"},{path:"bodyMaster",label:"身主"},{path:"daxianList.0.ages",label:"起大限"}],qimen:[{path:"siZhu.day",label:"日柱"},{path:"ju",label:"局数"},{path:"zhiFu.star",label:"值符"},{path:"zhiShi.gate",label:"值使"}]};function j(o,h){let d=o;for(const y of String(h).split(".")){if(d==null)return;d=d[y]}return d}function $(o){return o==null?"—":Array.isArray(o)?o.join("、"):typeof o=="object"?"—":String(o)}function g(o,h,d){return(N[o]||[]).map(x=>{const M=$(j(h,x.path)),O=$(j(d,x.path));return{key:x.path,label:x.label,current:M,alt:O,changed:M!==O}})}return{diffObjects:H,labelOf:I,categoryOf:k,rootOf:m,sortDiffs:f,summarize:_,formatValue:A,renderDiff:s,CALIBER_SWITCHES:u,CALIBER_VIEWS:N,viewCell:$,viewRows:g}})(),R.fingerprint=(function(){const P="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function B(q){return JSON.stringify(F(q))}function F(q){if(q===null)return null;const z=typeof q;if(z==="string")return typeof q.normalize=="function"?q.normalize("NFC"):q;if(z==="number")return Number.isFinite(q)?Object.is(q,-0)?0:q:null;if(z==="boolean")return q;if(Array.isArray(q))return q.map(F);if(z==="object"){const I=Object.create(null);for(const k of Object.keys(q).sort()){const m=q[k];m===void 0||typeof m=="function"||typeof m=="symbol"||(I[k]=F(m))}return I}return null}function H(q){const z=String(q);let I=2166136261,k=2654435769;for(let _=0;_<z.length;_+=1){const A=z.charCodeAt(_);for(const s of[A&255,A>>>8])I=Math.imul(I^s,16777619),k=Math.imul(k^s,2246822507)}let m=(I>>>0)*8+(k>>>29),f="";for(let _=0;_<7;_+=1)f=P[m%32]+f,m=Math.floor(m/32);return f}function Y(q={}){const z=String(q.system||""),I=String(q.version||"dev"),k=q.seed===void 0||q.seed===null||q.seed===""?null:Number(q.seed),m=q.asOf?String(q.asOf):null,f=q.params&&typeof q.params=="object"?q.params:{},_=B({system:z,params:f,seed:k,asOf:m}),A=B({base:_,version:I});return{id:`LY-${H(A)}`,baseId:`LY-${H(_)}`,version:I,system:z,payload:_}}return{canonicalJson:B,shortHash:H,fingerprintOf:Y}})(),R.validate=(function(){const{fail:P}=R.fail||{},B=1600,F=2400;function H(f){return f%4===0&&f%100!==0||f%400===0}function Y(f,_){return _===2?H(f)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][_-1]||0}const q=f=>typeof f=="string"?`「${f}」`:String(f),z="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function I(f,_=""){const A=_?`${_} 的`:"";if(!f||typeof f!="object"||Array.isArray(f)){const N=f===null?"null":Array.isArray(f)?"数组":typeof f;throw P("E_INPUT",`${A}入参必须是对象(收到 ${N});${z}`)}const s=f.hour===void 0?0:f.hour,c=f.minute===void 0?0:f.minute;for(const[N,j]of[["year",f.year],["month",f.month],["day",f.day],["hour",s],["minute",c]])if(!Number.isInteger(j))throw P("E_INPUT",`${A}${N} 必须是整数(收到 ${q(j)});${z}`);if(f.year<B||f.year>F)throw P("E_INPUT",`${A}year 超出支持范围 ${B}–${F}(收到 ${f.year});更早的年份时区与历法口径不可靠`);if(f.month<1||f.month>12)throw P("E_INPUT",`${A}month 超出范围 1–12(收到 ${f.month})`);const u=Y(f.year,f.month);if(f.day<1||f.day>u)throw P("E_INPUT",`${A}日期不存在:${f.year}-${f.month}-${f.day}(${f.year} 年 ${f.month} 月只有 ${u} 天)`);if(s<0||s>23)throw P("E_INPUT",`${A}hour 超出范围 0–23(收到 ${s})`);if(c<0||c>59)throw P("E_INPUT",`${A}minute 超出范围 0–59(收到 ${c})`);return f}function k(f,_,A){if(!f||typeof f!="object"||Array.isArray(f)){const s=f===null?"null":f===void 0?"undefined":Array.isArray(f)?"数组":typeof f;throw P("E_INPUT",`${_} 必须是对象(收到 ${s});${A}`)}return f}function m(f,_=""){const A=_?`${_}:`:"";if(f.year<B||f.year>F)throw P("E_RANGE",`${A}晚子时按次日归后落到 ${f.year}-${String(f.month).padStart(2,"0")}-${String(f.day).padStart(2,"0")},超出可计算范围 ${B}–${F};请把时刻挪到 23 点前,或换一天起课`);return f}return{MIN_YEAR:B,MAX_YEAR:F,isLeapYear:H,daysInMonth:Y,assertCivil:I,assertObject:k,assertShifted:m}})(),R.datetime=(function(){const{fail:P}=R.fail||{},{MIN_YEAR:B,MAX_YEAR:F}=R.validate||{};function H(z,I){return I===2?z%4===0&&z%100!==0||z%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][I-1]}function Y(z,I=""){const k=String(z??"").trim(),m=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(k);if(!m)return null;const f=Number(m[1]),_=Number(m[2]),A=Number(m[3]);if(_<1||_>12||A<1||A>H(f,_))return null;if(f<B||f>F){const s=I?`${I} `:"";throw P("E_RANGE",`${s}「${m[0]}」的年份超出可计算范围(${B}–${F},收到 ${f} 年);农历与节气表不覆盖之外的年份`)}return{year:f,month:_,day:A}}function q(z){if(typeof z!="string"||!z.trim())throw P("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const I=z.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!I)throw P("E_INPUT",`无法解析 datetime:「${z}」,请用 1990-05-12T14:30 这种格式`);if(I[6]!==void 0&&Number(I[6])>59)throw P("E_INPUT",`秒超出范围:${I[6]}`);const k={year:Number(I[1]),month:Number(I[2]),day:Number(I[3]),hour:Number(I[4]??0),minute:Number(I[5]??0)};if(k.month<1||k.month>12)throw P("E_INPUT",`月份超出范围:${k.month}`);const m=H(k.year,k.month);if(k.day<1||k.day>m)throw P("E_INPUT",`日期不存在:${k.year}-${k.month}-${k.day}(${k.year} 年 ${k.month} 月只有 ${m} 天)`);if(k.hour>23||k.minute>59)throw P("E_INPUT",`时间超出范围:${k.hour}:${k.minute}`);if(k.year<B||k.year>F)throw P("E_RANGE",`年份 ${k.year} 超出可计算范围(${B}–${F})`);return(k.year<1900||k.year>2100)&&(k.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${k.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),k}return{daysInMonth:H,parseYmd:Y,parseDateTime:q}})(),R.lru=(function(){function P({max:B=64,ttlMs:F=0,name:H="lru",now:Y=()=>Date.now()}={}){const q=new Map,z={name:H,hits:0,misses:0,evictions:0,expirations:0},I=k=>F>0&&Y()-k.at>F;return{name:H,max:B,ttlMs:F,get(k){const m=q.get(k);if(!m||I(m)){m&&(q.delete(k),z.expirations+=1),z.misses+=1;return}return q.delete(k),q.set(k,m),z.hits+=1,m.value},set(k,m){for(q.has(k)&&q.delete(k),q.set(k,{value:m,at:Y()});q.size>B;)q.delete(q.keys().next().value),z.evictions+=1;return m},has(k){const m=q.get(k);return m?I(m)?(q.delete(k),z.expirations+=1,!1):!0:!1},delete(k){return q.delete(k)},clear(){q.clear()},get size(){return q.size},stats(){const k=z.hits+z.misses;return{name:H,size:q.size,max:B,hits:z.hits,misses:z.misses,evictions:z.evictions,expirations:z.expirations,hitRate:k?z.hits/k:0}}}}return{createLru:P}})(),R.nayin=(function(){const P=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function B(F){const H=(Number(F)%60+60)%60,Y=P[Math.floor(H/2)];return{name:Y,element:Y[2]}}return{NAYIN_NAMES:P,nayinOf:B}})(),R.sanhe=(function(){const P=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],B=Object.fromEntries(P.map(Y=>[Y.branches.join(""),Y.element])),F=Object.fromEntries(P.flatMap(Y=>Y.branches.map(q=>[q,Y.element])));function H(Y){return P.find(q=>q.branches.includes(Y))||null}return{SANHE_GROUPS:P,SANHE:B,SANHE_ELEMENT:F,sanheGroupOf:H}})(),R["vsop-earth"]=(function(){const P=[[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]],B=[[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]],F=[[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]],H=[[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]],Y=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function q(z){let I=0;for(const[m,f,_]of P)I+=m*Math.cos(f+_*z);let k=1;for(const m of[B,F,H,Y]){k*=z;for(const[f,_,A]of m)I+=f*k*Math.cos(_+A*z)}return I}return{earthL:q}})(),R.calendar=(function(){const{earthL:P}=R["vsop-earth"]||{},{createLru:B}=R.lru||{},{bool:F}=R.bool||{},H=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],Y=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],q=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function z(S){return(285+15*S)%360}function I(S,T,L){const K=Math.floor((14-T)/12),Q=S+4800-K,oe=T+12*K-3;return L+Math.floor((153*oe+2)/5)+365*Q+Math.floor(Q/4)-Math.floor(Q/100)+Math.floor(Q/400)-32045}function k(S){const T=S+32044,L=Math.floor((4*T+3)/146097),K=T-Math.floor(146097*L/4),Q=Math.floor((4*K+3)/1461),oe=K-Math.floor(1461*Q/4),ie=Math.floor((5*oe+2)/153);return{year:100*L+Q-4800+Math.floor(ie/10),month:ie+3-12*Math.floor(ie/10),day:oe-Math.floor((153*ie+2)/5)+1}}function m(S,T){for(let L=0;L<60;L++)if(L%10===S&&L%12===T)return L;return-1}function f(S){const T=(S%60+60)%60;return{index:T,stem:H[T%10],branch:Y[T%12],name:H[T%10]+Y[T%12]}}function _(S){return((S+49)%60+60)%60}function A(S){const T=S-2451545,L=T/36525,K=T/365250;let Q=P(K)*180/Math.PI+180;Q=(Q%360+360)%360;const oe=(5029.0966*L+1.11113*L*L-6e-6*L*L*L)/3600;Q+=oe,Q-=.09033/3600;const ie=(125.04452-1934.136261*L)*Math.PI/180,ue=(280.4665+36000.7698*L)*Math.PI/180,U=(218.3165+481267.8813*L)*Math.PI/180,ce=(-17.2*Math.sin(ie)-1.32*Math.sin(2*ue)-.23*Math.sin(2*U)+.21*Math.sin(2*ie))/3600;Q+=ce;const le=(357.52911+35999.05029*L-1537e-7*L*L)*Math.PI/180,be=.016708634-42037e-9*L-1267e-10*L*L,Ne=1.000001018*(1-be*be)/(1+be*Math.cos(le+(1.914602-.004817*L)*(Math.PI/180)*Math.sin(le)));return Q-=20.4898/3600/(Ne||1),(Q%360+360)%360}function s(S){if(S<1900){const ie=S;if(ie<1600)return 120;if(ie<1700){const U=ie-1600;return 120-.9808*U-.01532*U*U+U*U*U/7129}if(ie<1800){const U=ie-1700;return 8.83+.1603*U-.0059285*U*U+13336e-8*U*U*U-U**4/1174e3}if(ie<1860){const U=ie-1800;return 13.72-.332447*U+.0068612*U*U+.0041116*U**3-37436e-8*U**4+121272e-10*U**5-1699e-10*U**6+875e-12*U**7}const ue=ie-1860;return 7.62+.5737*ue-.251754*ue*ue+.01680668*ue**3-.0004473624*ue**4+ue**5/233174}const T=[[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(S<=T[0][0])return T[0][1];for(let ie=1;ie<T.length;ie++)if(S<=T[ie][0]){const[ue,U]=T[ie-1],[ce,le]=T[ie];return U+(le-U)*(S-ue)/(ce-ue)}const[L,K]=T[T.length-1],Q=(L-1820)/100,oe=(S-1820)/100;return K+32*(oe*oe-Q*Q)}const c=8/24,u=7.7611/24,N=2425612+4/24;function j(S){return S<N?u:c}const $=B({max:4096,name:"termInstant"}),g=1e-5,o=new Map,h=365.2422;function d(S,T){const L=z(T),K=I(S,1,5)-.5+T*15.2184,Q=o.get(T);let oe=Q!==void 0?Q+h:K;Math.abs(oe-K)>20&&(oe=K);for(let ue=0;ue<12;ue++){let U=L-A(oe);if(U=((U+180)%360+360)%360-180,oe+=U/.98564736,Math.abs(U)<g)break}o.set(T,oe);const ie=oe-s(S)/86400;return ie+j(ie)}function y(S,T){const L=S*24+T,K=$.get(L);if(K!==void 0)return K;const Q=d(S,T);return $.set(L,Q),Q}function x(S){const T=Math.floor(S+.5),L=S+.5-T,K=Math.min(1439,Math.floor(Math.round(L*86400)/60)),{year:Q,month:oe,day:ie}=k(T);return{year:Q,month:oe,day:ie,hour:Math.floor(K/60),minute:K%60}}function M({year:S,month:T,day:L,hour:K=0,minute:Q=0}){return I(S,T,L)-.5+(K*60+Q)/1440}function O(S,T,L){const K=I(S,T,L)-I(S,1,1)+1,Q=2*Math.PI*(K-81)/364;return 9.87*Math.sin(2*Q)-7.53*Math.cos(Q)-1.5*Math.sin(Q)}const G=B({max:8,name:"termWindow"}),se=B({max:32,name:"termYear"}),C=Array.from({length:24},(S,T)=>T),X=C.filter(S=>S%2===0);function me(S,T){const L=T?`${S}|jie`:`${S}|all`,K=se.get(L);if(K)return K;if(T){const oe=se.get(`${S}|all`);if(oe){const ie=oe.filter(ue=>ue.index%2===0);return se.set(L,ie),ie}}const Q=[];for(const oe of T?X:C)Q.push({year:S,index:oe,name:q[oe],jd:y(S,oe)});return Q.sort((oe,ie)=>oe.jd-ie.jd),se.set(L,Q),Q}function $e(S,T={}){const L=F(T.jieOnly),K=L?`${S}|jie`:S,Q=G.get(K);if(Q)return Q;const oe=[...me(S-1,L),...me(S,L),...me(S+1,L)];return oe.sort((ie,ue)=>ie.jd-ue.jd),G.set(K,oe),oe}function ze(S){if(typeof S!="string"||S.length<2)return[];const T=H.indexOf(S[0]),L=Y.indexOf(S[1]);if(T<0||L<0)return[];const K=m(T,L);if(K<0)return[];const Q=Math.floor(K/10)*10;return[Y[(Q+10)%12],Y[(Q+11)%12]]}function a(S,T){let L=null;for(const K of S)if(K.index%2===0)if(K.jd<=T)L=K;else break;return L}function b(S,T){for(const L of S)if(L.index%2===0&&L.jd>T)return L;return null}function D(S){const T=x(S),L=K=>String(K).padStart(2,"0");return`${T.year}-${L(T.month)}-${L(T.day)} ${L(T.hour)}:${L(T.minute)}`}function ee(){return[$.stats(),se.stats(),G.stats()]}return{STEMS:H,BRANCHES:Y,TERM_NAMES:q,termLongitude:z,toJDN:I,fromJDN:k,sexagenaryIndex:m,ganzhiName:f,dayGanzhiIndex:_,sunLongitude:A,deltaTSeconds:s,OFFSET_MODERN:c,OFFSET_BEIJING_LOCAL:u,CUTOVER_JD:N,localOffsetFor:j,termInstantJd:y,jdToParts:x,partsToJd:M,equationOfTime:O,termWindow:$e,xunKongOf:ze,previousJie:a,nextJie:b,formatJd:D,cacheMetrics:ee}})(),R.lunar=(function(){const{toJDN:P,jdToParts:B,termInstantJd:F,deltaTSeconds:H,localOffsetFor:Y}=R.calendar||{},q=29.530588861,z=245155009766e-5,I=Math.PI/180;function k(s){const c=s/1236.85,u=z+q*s+15437e-8*c*c-15e-8*c*c*c+73e-11*c*c*c*c,N=1-.002516*c-74e-7*c*c,j=(2.5534+29.1053567*s-14e-7*c*c-11e-8*c*c*c)*I,$=(201.5643+385.81693528*s+.0107582*c*c+1238e-8*c*c*c-58e-9*c*c*c*c)*I,g=(160.7108+390.67050284*s-.0016118*c*c-227e-8*c*c*c+11e-9*c*c*c*c)*I,o=(124.7746-1.56375588*s+.0020672*c*c+215e-8*c*c*c)*I,h=-.4072*Math.sin($)+.17241*N*Math.sin(j)+.01608*Math.sin(2*$)+.01039*Math.sin(2*g)+.00739*N*Math.sin($-j)-.00514*N*Math.sin($+j)+.00208*N*N*Math.sin(2*j)-.00111*Math.sin($-2*g)-57e-5*Math.sin($+2*g)+56e-5*N*Math.sin(2*$+j)-42e-5*Math.sin(3*$)+42e-5*N*Math.sin(j+2*g)+38e-5*N*Math.sin(j-2*g)-24e-5*N*Math.sin(2*$-j)-17e-5*Math.sin(o)-7e-5*Math.sin($+2*j)+4e-5*Math.sin(2*$-2*g)+4e-5*Math.sin(3*j)+3e-5*Math.sin($+j-2*g)+3e-5*Math.sin(2*$+2*g)-3e-5*Math.sin($+j+2*g)+3e-5*Math.sin($-j+2*g)-2e-5*Math.sin($-j-2*g)-2e-5*Math.sin(3*$+j)+2e-5*Math.sin(4*$),d=u+h-H(2e3+c*100)/86400;return d+Y(d)}function m(s){return Math.floor(s+.5)}function f(s){return Math.round((s+.5-z)/q)}function _(s,c,u){for(let N=s-1;N<=s+1;N++)for(let j=1;j<24;j+=2){const $=F(N,j),g=m($);if(g>=c&&g<u)return{index:j,jd:$}}return null}function A(s,c,u){const N=P(s,c,u),j=m(F(s,23)),$=N<j?s-1:s,g=m(F($,23));let o=f(g);for(;m(k(o))>g;)o--;for(;m(k(o+1))<=g;)o++;const h=m(F($+1,23));let d=o;for(;m(k(d+1))<=h;)d++;const y=d-o;let x=-1;if(y===13)for(let G=1;G<=y;G++){const se=m(k(o+G-1)),C=m(k(o+G));if(!_($,se,C)){x=G;break}}let M=11,O=!1;for(let G=1;G<=15;G++){const se=m(k(o+G-1)),C=m(k(o+G)),X=_($,se,C),me=G===x;if(N>=se&&N<C){const $e=B(k(o+G-1)),ze=me?(M+10)%12+1:M;return{year:$,lunarYear:O?$+1:$,month:ze,day:N-se+1,isLeap:me,monthStart:`${$e.year}-${String($e.month).padStart(2,"0")}-${String($e.day).padStart(2,"0")}`,hasZhongQi:!!X}}me||(M=M%12+1,M===1&&(O=!0))}throw new Error(`农历换算失败:${s}-${c}-${u}`)}return{SYNODIC:q,newMoonJd:k,dayNumberOf:m,solarToLunar:A}})(),R.geo=(function(){const{bool:P}=R.bool||{},B=`
1
+ window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.constitution.js",factory(Mt){const R={};return R.fail=(function(){return{fail:(B,F)=>{const H=new Error(F);return H.code=B,H}}})(),R.bool=(function(){function P(s,c=!1){return s==null||s===""?c:s===!0||s===1||s==="true"||s==="1"?!0:s===!1||s===0||s==="false"||s==="0"?!1:c}const B={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},F={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function H(s,c){let u=s;const N=($,g)=>{Object.is(s[$],g)||(u===s&&(u={...s}),u[$]=g)},S=$=>{u===s&&(u={...s}),delete u[$]};for(const[$,g]of Object.entries(c))if(s[$]!==void 0){if(typeof s[$]=="string"&&s[$].trim()===""){S($);continue}N($,P(s[$],g))}return u}function D(s){if(!s||typeof s!="object"||Array.isArray(s))return s;let c=s;for(const[u,N]of Object.entries(F)){if(s[u]===void 0)continue;if(typeof s[u]=="string"&&s[u].trim()===""){c===s&&(c={...s}),delete c[u];continue}const S=P(s[u],N);Object.is(s[u],S)||(c===s&&(c={...s}),c[u]=S)}return c}function q(s){if(!s||typeof s!="object")return s;let c=H(s,B);for(const u of["partner","partner2"]){const N=c[u],S=D(N);S!==N&&(c===s&&(c={...s}),c[u]=S)}return c}const z=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],I=["lines","rectifyHours","answers"],k=["strokeOverrides","surnameStrokes"],m=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function f(s){if(typeof s!="string")return s;const c=s.trim();if(!m.test(c))return s;const u=Number(c);return Number.isFinite(u)?u:s}function L(s){let c=!1;const u={};for(const[N,S]of Object.entries(s)){const $=S===null?null:f(S);Object.is($,S)||(c=!0),u[N]=$}return c?u:s}function A(s){if(!s||typeof s!="object")return s;let c=s;const u=(N,S)=>{Object.is(s[N],S)||(c===s&&(c={...s}),c[N]=S)};for(const N of z)if(s[N]!==void 0){if(typeof s[N]=="string"&&s[N].trim()===""){c===s&&(c={...s}),delete c[N];continue}u(N,f(s[N]))}for(const N of I){const S=s[N];if(!Array.isArray(S))continue;let $=!1;const g=S.map(o=>{if(o===null)return null;if(typeof o=="string"&&o.trim()===""){$=!0;return}const d=f(o);return Object.is(d,o)||($=!0),d});$&&u(N,g)}for(const N of k){const S=s[N];!S||typeof S!="object"||Array.isArray(S)||u(N,L(S))}return c}return{bool:P,FLAG_DEFAULTS:B,canonicalFlags:q,NUMERIC_KEYS:z,NUMERIC_ARRAY_KEYS:I,NUMERIC_MAP_KEYS:k,canonicalNumbers:A}})(),R.diff=(function(){const{bool:P}=R.bool||{},B=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),F=o=>o!==null&&typeof o=="object";function H(o,d,h="",y=[]){if(o===d)return y;if(!F(o)||!F(d))return y.push({path:h||"(root)",from:o,to:d}),y;const x=new Set([...Object.keys(o),...Object.keys(d)]);for(const M of x){if(B.has(M))continue;const v=h?`${h}.${M}`:M,G=o[M],se=d[M];F(G)&&F(se)?H(G,se,v,y):JSON.stringify(G)!==JSON.stringify(se)&&y.push({path:v,from:G,to:se})}return y}const D=[[/^pillars\.year\.ganzhi$/,"年柱"],[/^pillars\.month\.ganzhi$/,"月柱"],[/^pillars\.day\.ganzhi$/,"日柱"],[/^pillars\.hour\.ganzhi$/,"时柱"],[/^pillars\.\w+\.hidden/,"藏干"],[/^pillars\.\w+\.stemTenGod$/,"十神"],[/^pillars\.\w+\.kongwang/,"空亡"],[/^pillars\.\w+\.dishi$|^pillars\.\w+\.zizuo$/,"十二长生"],[/^pillars\.\w+\.nayin$/,"纳音"],[/^dayMaster\./,"日主"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\.(palace|branch|stem|ganzhi)$/,"宫位"],[/^palaces\.\d+\.stars\.\d+\.(name|brightness|type)$/,"星曜"],[/^palaces\.\d+\.shensha\./,"神煞"],[/^palaces\.\d+\.(daxian|xiaoxian)\./,"大限"],[/^palaces\.\d+\.sanfang\./,"三方四正"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\./,"命宫"],[/^body\./,"身宫"],[/^doujun\./,"流年斗君"],[/^siZhu\.year$/,"年柱"],[/^siZhu\.month$/,"月柱"],[/^siZhu\.day$/,"日柱"],[/^siZhu\.time$/,"时柱"],[/^ju$|^juNumber$/,"局数"],[/^yuan$/,"三元"],[/^dun$/,"阴阳遁"],[/^daxian(List)?\./,"大限"],[/^fly(Chains|Composite)?\./,"飞星"],[/^pattern/,"格局"],[/^schools\./,"流派回显"],[/^dayun\.jiao\./,"起运"],[/^dayun\.toNextJieDays$/,"起运时间"],[/^dayun\.list\.(\d+)\.ganzhi$/,"大运干支"],[/^dayun\.startAge(Exact)?\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],q=[[/^pillars\./,"四柱"],[/^shensha\./,"神煞"],[/^dayun\./,"大运"],[/^liunian\./,"流年"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^dayMaster\./,"日主"],[/^relations\./,"干支关系"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\.|^body\.|^doujun\./,"命身宫"],[/^siZhu\./,"四柱"],[/^ju$|^juNumber$|^yuan$|^dun$/,"局数"],[/^daxian/,"大限"],[/^fly/,"飞星"],[/^pattern/,"格局"],[/^jieqi\./,"节气"],[/^solarTime\./,"真太阳时"],[/^input\./,"输入回显"],[/^lines\./,"爻"]],z=[[/^pillars\.(year|month|day|hour)\.ganzhi$/,"柱"],[/^palaces\.(minggong|shengong)\.ganzhi$/,"命身宫"],[/^soul\.ganzhi$/,"命宫"],[/^body\.branch$/,"身宫"],[/^siZhu\.(year|month|day|time)$/,"柱"],[/^dayun\.jiao\.at$/,"起运"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^ju$|^juNumber$|^juName$/,"局数"],[/^dun$/,"阴阳遁"],[/^lines\.\d+\.(ganzhi|yinYang|name)$/,"爻"],[/^yueJiang\.(name|zhi)$/,"月将"]];function I(o){for(const[d,h]of D)if(d.test(o))return h;return k(o)||o}function k(o){for(const[d,h]of q)if(d.test(o))return h;return""}function m(o){for(const[d,h]of z)if(d.test(o))return h;return""}function f(o){return[...o].sort((d,h)=>d.path.localeCompare(h.path,"zh-Hans-CN",{numeric:!0}))}function L(o){if(!o.length)return"本盘不受此口径影响:所有字段一致。";const d=o.filter(M=>m(M.path)),h=[...new Set(o.map(M=>k(M.path)).filter(Boolean))],y=d.length?`根因 ${d.length} 处:`+d.slice(0,4).map(M=>`${I(M.path)} ${A(M.from)}→${A(M.to)}`).join("、")+(d.length>4?" 等":""):"无单一根因",x=h.length?`;连带影响 ${h.slice(0,6).join("、")}${h.length>6?" 等":""} ${h.length} 类,共 ${o.length} 处`:`;共 ${o.length} 处`;return y+x+"。"}const A=o=>o===void 0?"—":o===null?"null":typeof o=="string"?o:Array.isArray(o)?o.join("")||"[]":typeof o=="object"?JSON.stringify(o):String(o);function s(o,{title:d="",limit:h=12}={}){const y=[];if(d&&y.push(`【${d}】`),y.push(L(o)),!o.length)return y.join(`
2
+ `);const x=f(o.filter(v=>m(v.path))),M=f(o.filter(v=>!m(v.path)));if(x.length){y.push(""),y.push(" 根因(口径直接改动):");for(const v of x)y.push(` ${I(v.path).padEnd(6)} ${A(v.from)} → ${A(v.to)}`)}if(M.length){y.push(""),y.push(` 连带变化(${M.length} 处,展示前 ${Math.min(h,M.length)} 处):`);for(const v of M.slice(0,h))y.push(` ${I(v.path).padEnd(6)} ${A(v.from)} → ${A(v.to)}`);if(M.length>h){const v={};for(const G of M.slice(h)){const se=k(G.path)||"其他";v[se]=(v[se]||0)+1}y.push(" 其余:"+Object.entries(v).map(([G,se])=>`${G} ${se} 处`).join("、"))}}return y.join(`
3
+ `)}const c=(o,d,h,y,x,M)=>({key:o,title:d,short:h,read:v=>{const G=v[o]!==void 0?v[o]:v.schools&&v.schools[o];return M[G]?G:y},alt:v=>v===x?y:x,label:v=>M[v]||v}),u={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:o=>P(o.lateZi,!0),alt:o=>!o,label:o=>o?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>P(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"}],ziwei:[{key:"leapMonth",title:"闰月归月:按日切分 / 整月归次月",short:"闰月归月",read:o=>o.leapMonth==="next"||o.leapMonth==="prev"?o.leapMonth:"split",alt:o=>o==="split"?"next":"split",label:o=>({split:"按日切分",next:"整月归次月",prev:"整月归本月"})[o]||o},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>P(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"},c("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),c("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),c("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),c("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),c("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),c("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣"}),c("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),c("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),c("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"}),c("shenzhuSchool","身主:子午皆火星 / 子铃午火","身主","common","verse",{common:"子午皆火星",verse:"子铃午火(安身主诀逐字)"}),c("mingzhuSchool","命主取法:命宫地支 / 生年年支","命主取法","soul-branch","year-branch",{"soul-branch":"命宫地支(通行本)","year-branch":"生年年支(中州派)"}),c("zuoyaoSchool","杂曜:49 颗简盘 / 61 颗全表","杂曜全表","minimal","full",{minimal:"49 颗(简盘)",full:"61 颗(加十二颗杂曜)"}),c("liunianSihua","流年四化取干:流年天干 / 流年命宫宫干","流年四化取干","year-stem","life-palace-stem",{"year-stem":"流年天干","life-palace-stem":"流年命宫宫干"}),c("sihuaVariant","十干四化:通行表 / 变体整表替换","十干四化变体","default","廉破曲阳",{default:"各干通行表",廉破曲阳:"甲干 廉破曲阳",贪阴阳机:"戊干 贪阴阳机",阳武同阴:"庚干 阳武同阴",阳武府同:"庚干 阳武府同",阳武府相:"庚干 阳武府相",阳武同相:"庚干 阳武同相",巨阳武昌:"辛干 巨阳武昌",梁紫府武:"壬干 梁紫府武",梁紫相武:"壬干 梁紫相武",破巨阳贪:"癸干 破巨阳贪"}),c("jieluSchool","截路空亡:照常 / 不排(中州派)","截路空亡","off","zhongzhou",{off:"照常(截空/副截/旬空/副旬)",zhongzhou:"不排(中州派)"}),c("suipoSchool","岁前十二神:照常 / 大耗改岁破(中州派)","岁前十二神","off","zhongzhou",{off:"照常(大耗)",zhongzhou:"大耗改岁破"})],qimen:[{key:"juMethod",title:"取局流派:拆补 / 超神接气 / 置闰",short:"取局流派",read:o=>["chaibu","chaoshen","zhirun"].includes(o.juMethod)?o.juMethod:"chaibu",alt:o=>o==="chaibu"?"zhirun":"chaibu",label:o=>({chaibu:"拆补法",chaoshen:"超神接气",zhirun:"置闰法"})[o]||o},{key:"lateZiHourMode",title:"晚子时:23:00 后归当日 / 次日",short:"晚子时归日",read:o=>o.lateZiHourMode==="next-day"?"next-day":"same-day",alt:o=>o==="next-day"?"same-day":"next-day",label:o=>o==="next-day"?"归次日":"归当日"}]},N={bazi:[{path:"pillars.day.ganzhi",label:"日柱"},{path:"pillars.hour.ganzhi",label:"时柱"},{path:"strength.level",label:"旺衰"},{path:"frame.primaryName",label:"格局"},{path:"frame.yongshen.favor",label:"喜用"},{path:"dayun.jiao.at",label:"起运"}],ziwei:[{path:"soul.ganzhi",label:"命宫"},{path:"body.branch",label:"身宫支"},{path:"bureau.name",label:"五行局"},{path:"bodyMaster",label:"身主"},{path:"daxianList.0.ages",label:"起大限"}],qimen:[{path:"siZhu.day",label:"日柱"},{path:"ju",label:"局数"},{path:"zhiFu.star",label:"值符"},{path:"zhiShi.gate",label:"值使"}]};function S(o,d){let h=o;for(const y of String(d).split(".")){if(h==null)return;h=h[y]}return h}function $(o){return o==null?"—":Array.isArray(o)?o.join("、"):typeof o=="object"?"—":String(o)}function g(o,d,h){return(N[o]||[]).map(x=>{const M=$(S(d,x.path)),v=$(S(h,x.path));return{key:x.path,label:x.label,current:M,alt:v,changed:M!==v}})}return{diffObjects:H,labelOf:I,categoryOf:k,rootOf:m,sortDiffs:f,summarize:L,formatValue:A,renderDiff:s,CALIBER_SWITCHES:u,CALIBER_VIEWS:N,viewCell:$,viewRows:g}})(),R.fingerprint=(function(){const P="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function B(q){return JSON.stringify(F(q))}function F(q){if(q===null)return null;const z=typeof q;if(z==="string")return typeof q.normalize=="function"?q.normalize("NFC"):q;if(z==="number")return Number.isFinite(q)?Object.is(q,-0)?0:q:null;if(z==="boolean")return q;if(Array.isArray(q))return q.map(F);if(z==="object"){const I=Object.create(null);for(const k of Object.keys(q).sort()){const m=q[k];m===void 0||typeof m=="function"||typeof m=="symbol"||(I[k]=F(m))}return I}return null}function H(q){const z=String(q);let I=2166136261,k=2654435769;for(let L=0;L<z.length;L+=1){const A=z.charCodeAt(L);for(const s of[A&255,A>>>8])I=Math.imul(I^s,16777619),k=Math.imul(k^s,2246822507)}let m=(I>>>0)*8+(k>>>29),f="";for(let L=0;L<7;L+=1)f=P[m%32]+f,m=Math.floor(m/32);return f}function D(q={}){const z=String(q.system||""),I=String(q.version||"dev"),k=q.seed===void 0||q.seed===null||q.seed===""?null:Number(q.seed),m=q.asOf?String(q.asOf):null,f=q.params&&typeof q.params=="object"?q.params:{},L=B({system:z,params:f,seed:k,asOf:m}),A=B({base:L,version:I});return{id:`LY-${H(A)}`,baseId:`LY-${H(L)}`,version:I,system:z,payload:L}}return{canonicalJson:B,shortHash:H,fingerprintOf:D}})(),R.validate=(function(){const{fail:P}=R.fail||{},B=1600,F=2400;function H(f){return f%4===0&&f%100!==0||f%400===0}function D(f,L){return L===2?H(f)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][L-1]||0}const q=f=>typeof f=="string"?`「${f}」`:String(f),z="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function I(f,L=""){const A=L?`${L} 的`:"";if(!f||typeof f!="object"||Array.isArray(f)){const N=f===null?"null":Array.isArray(f)?"数组":typeof f;throw P("E_INPUT",`${A}入参必须是对象(收到 ${N});${z}`)}const s=f.hour===void 0?0:f.hour,c=f.minute===void 0?0:f.minute;for(const[N,S]of[["year",f.year],["month",f.month],["day",f.day],["hour",s],["minute",c]])if(!Number.isInteger(S))throw P("E_INPUT",`${A}${N} 必须是整数(收到 ${q(S)});${z}`);if(f.year<B||f.year>F)throw P("E_INPUT",`${A}year 超出支持范围 ${B}–${F}(收到 ${f.year});更早的年份时区与历法口径不可靠`);if(f.month<1||f.month>12)throw P("E_INPUT",`${A}month 超出范围 1–12(收到 ${f.month})`);const u=D(f.year,f.month);if(f.day<1||f.day>u)throw P("E_INPUT",`${A}日期不存在:${f.year}-${f.month}-${f.day}(${f.year} 年 ${f.month} 月只有 ${u} 天)`);if(s<0||s>23)throw P("E_INPUT",`${A}hour 超出范围 0–23(收到 ${s})`);if(c<0||c>59)throw P("E_INPUT",`${A}minute 超出范围 0–59(收到 ${c})`);return f}function k(f,L,A){if(!f||typeof f!="object"||Array.isArray(f)){const s=f===null?"null":f===void 0?"undefined":Array.isArray(f)?"数组":typeof f;throw P("E_INPUT",`${L} 必须是对象(收到 ${s});${A}`)}return f}function m(f,L=""){const A=L?`${L}:`:"";if(f.year<B||f.year>F)throw P("E_RANGE",`${A}晚子时按次日归后落到 ${f.year}-${String(f.month).padStart(2,"0")}-${String(f.day).padStart(2,"0")},超出可计算范围 ${B}–${F};请把时刻挪到 23 点前,或换一天起课`);return f}return{MIN_YEAR:B,MAX_YEAR:F,isLeapYear:H,daysInMonth:D,assertCivil:I,assertObject:k,assertShifted:m}})(),R.datetime=(function(){const{fail:P}=R.fail||{},{MIN_YEAR:B,MAX_YEAR:F}=R.validate||{};function H(z,I){return I===2?z%4===0&&z%100!==0||z%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][I-1]}function D(z,I=""){const k=String(z??"").trim(),m=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(k);if(!m)return null;const f=Number(m[1]),L=Number(m[2]),A=Number(m[3]);if(L<1||L>12||A<1||A>H(f,L))return null;if(f<B||f>F){const s=I?`${I} `:"";throw P("E_RANGE",`${s}「${m[0]}」的年份超出可计算范围(${B}–${F},收到 ${f} 年);农历与节气表不覆盖之外的年份`)}return{year:f,month:L,day:A}}function q(z){if(typeof z!="string"||!z.trim())throw P("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const I=z.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!I)throw P("E_INPUT",`无法解析 datetime:「${z}」,请用 1990-05-12T14:30 这种格式`);if(I[6]!==void 0&&Number(I[6])>59)throw P("E_INPUT",`秒超出范围:${I[6]}`);const k={year:Number(I[1]),month:Number(I[2]),day:Number(I[3]),hour:Number(I[4]??0),minute:Number(I[5]??0)};if(k.month<1||k.month>12)throw P("E_INPUT",`月份超出范围:${k.month}`);const m=H(k.year,k.month);if(k.day<1||k.day>m)throw P("E_INPUT",`日期不存在:${k.year}-${k.month}-${k.day}(${k.year} 年 ${k.month} 月只有 ${m} 天)`);if(k.hour>23||k.minute>59)throw P("E_INPUT",`时间超出范围:${k.hour}:${k.minute}`);if(k.year<B||k.year>F)throw P("E_RANGE",`年份 ${k.year} 超出可计算范围(${B}–${F})`);return(k.year<1900||k.year>2100)&&(k.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${k.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),k}return{daysInMonth:H,parseYmd:D,parseDateTime:q}})(),R.lru=(function(){function P({max:B=64,ttlMs:F=0,name:H="lru",now:D=()=>Date.now()}={}){const q=new Map,z={name:H,hits:0,misses:0,evictions:0,expirations:0},I=k=>F>0&&D()-k.at>F;return{name:H,max:B,ttlMs:F,get(k){const m=q.get(k);if(!m||I(m)){m&&(q.delete(k),z.expirations+=1),z.misses+=1;return}return q.delete(k),q.set(k,m),z.hits+=1,m.value},set(k,m){for(q.has(k)&&q.delete(k),q.set(k,{value:m,at:D()});q.size>B;)q.delete(q.keys().next().value),z.evictions+=1;return m},has(k){const m=q.get(k);return m?I(m)?(q.delete(k),z.expirations+=1,!1):!0:!1},delete(k){return q.delete(k)},clear(){q.clear()},get size(){return q.size},stats(){const k=z.hits+z.misses;return{name:H,size:q.size,max:B,hits:z.hits,misses:z.misses,evictions:z.evictions,expirations:z.expirations,hitRate:k?z.hits/k:0}}}}return{createLru:P}})(),R.nayin=(function(){const P=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function B(F){const H=(Number(F)%60+60)%60,D=P[Math.floor(H/2)];return{name:D,element:D[2]}}return{NAYIN_NAMES:P,nayinOf:B}})(),R.sanhe=(function(){const P=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],B=Object.fromEntries(P.map(D=>[D.branches.join(""),D.element])),F=Object.fromEntries(P.flatMap(D=>D.branches.map(q=>[q,D.element])));function H(D){return P.find(q=>q.branches.includes(D))||null}return{SANHE_GROUPS:P,SANHE:B,SANHE_ELEMENT:F,sanheGroupOf:H}})(),R["vsop-earth"]=(function(){const P=[[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]],B=[[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]],F=[[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]],H=[[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]],D=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function q(z){let I=0;for(const[m,f,L]of P)I+=m*Math.cos(f+L*z);let k=1;for(const m of[B,F,H,D]){k*=z;for(const[f,L,A]of m)I+=f*k*Math.cos(L+A*z)}return I}return{earthL:q}})(),R.calendar=(function(){const{earthL:P}=R["vsop-earth"]||{},{createLru:B}=R.lru||{},{bool:F}=R.bool||{},H=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],D=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],q=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function z(j){return(285+15*j)%360}function I(j,E,_){const J=Math.floor((14-E)/12),V=j+4800-J,oe=E+12*J-3;return _+Math.floor((153*oe+2)/5)+365*V+Math.floor(V/4)-Math.floor(V/100)+Math.floor(V/400)-32045}function k(j){const E=j+32044,_=Math.floor((4*E+3)/146097),J=E-Math.floor(146097*_/4),V=Math.floor((4*J+3)/1461),oe=J-Math.floor(1461*V/4),ie=Math.floor((5*oe+2)/153);return{year:100*_+V-4800+Math.floor(ie/10),month:ie+3-12*Math.floor(ie/10),day:oe-Math.floor((153*ie+2)/5)+1}}function m(j,E){for(let _=0;_<60;_++)if(_%10===j&&_%12===E)return _;return-1}function f(j){const E=(j%60+60)%60;return{index:E,stem:H[E%10],branch:D[E%12],name:H[E%10]+D[E%12]}}function L(j){return((j+49)%60+60)%60}function A(j){const E=j-2451545,_=E/36525,J=E/365250;let V=P(J)*180/Math.PI+180;V=(V%360+360)%360;const oe=(5029.0966*_+1.11113*_*_-6e-6*_*_*_)/3600;V+=oe,V-=.09033/3600;const ie=(125.04452-1934.136261*_)*Math.PI/180,ue=(280.4665+36000.7698*_)*Math.PI/180,U=(218.3165+481267.8813*_)*Math.PI/180,ce=(-17.2*Math.sin(ie)-1.32*Math.sin(2*ue)-.23*Math.sin(2*U)+.21*Math.sin(2*ie))/3600;V+=ce;const le=(357.52911+35999.05029*_-1537e-7*_*_)*Math.PI/180,be=.016708634-42037e-9*_-1267e-10*_*_,Ne=1.000001018*(1-be*be)/(1+be*Math.cos(le+(1.914602-.004817*_)*(Math.PI/180)*Math.sin(le)));return V-=20.4898/3600/(Ne||1),(V%360+360)%360}function s(j){if(j<1900){const ie=j;if(ie<1600)return 120;if(ie<1700){const U=ie-1600;return 120-.9808*U-.01532*U*U+U*U*U/7129}if(ie<1800){const U=ie-1700;return 8.83+.1603*U-.0059285*U*U+13336e-8*U*U*U-U**4/1174e3}if(ie<1860){const U=ie-1800;return 13.72-.332447*U+.0068612*U*U+.0041116*U**3-37436e-8*U**4+121272e-10*U**5-1699e-10*U**6+875e-12*U**7}const ue=ie-1860;return 7.62+.5737*ue-.251754*ue*ue+.01680668*ue**3-.0004473624*ue**4+ue**5/233174}const E=[[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(j<=E[0][0])return E[0][1];for(let ie=1;ie<E.length;ie++)if(j<=E[ie][0]){const[ue,U]=E[ie-1],[ce,le]=E[ie];return U+(le-U)*(j-ue)/(ce-ue)}const[_,J]=E[E.length-1],V=(_-1820)/100,oe=(j-1820)/100;return J+32*(oe*oe-V*V)}const c=8/24,u=7.7611/24,N=2425612+4/24;function S(j){return j<N?u:c}const $=B({max:4096,name:"termInstant"}),g=1e-5,o=new Map,d=365.2422;function h(j,E){const _=z(E),J=I(j,1,5)-.5+E*15.2184,V=o.get(E);let oe=V!==void 0?V+d:J;Math.abs(oe-J)>20&&(oe=J);for(let ue=0;ue<12;ue++){let U=_-A(oe);if(U=((U+180)%360+360)%360-180,oe+=U/.98564736,Math.abs(U)<g)break}o.set(E,oe);const ie=oe-s(j)/86400;return ie+S(ie)}function y(j,E){const _=j*24+E,J=$.get(_);if(J!==void 0)return J;const V=h(j,E);return $.set(_,V),V}function x(j){const E=Math.floor(j+.5),_=j+.5-E,J=Math.min(1439,Math.floor(Math.round(_*86400)/60)),{year:V,month:oe,day:ie}=k(E);return{year:V,month:oe,day:ie,hour:Math.floor(J/60),minute:J%60}}function M({year:j,month:E,day:_,hour:J=0,minute:V=0}){return I(j,E,_)-.5+(J*60+V)/1440}function v(j,E,_){const J=I(j,E,_)-I(j,1,1)+1,V=2*Math.PI*(J-81)/364;return 9.87*Math.sin(2*V)-7.53*Math.cos(V)-1.5*Math.sin(V)}const G=B({max:8,name:"termWindow"}),se=B({max:32,name:"termYear"}),C=Array.from({length:24},(j,E)=>E),Q=C.filter(j=>j%2===0);function me(j,E){const _=E?`${j}|jie`:`${j}|all`,J=se.get(_);if(J)return J;if(E){const oe=se.get(`${j}|all`);if(oe){const ie=oe.filter(ue=>ue.index%2===0);return se.set(_,ie),ie}}const V=[];for(const oe of E?Q:C)V.push({year:j,index:oe,name:q[oe],jd:y(j,oe)});return V.sort((oe,ie)=>oe.jd-ie.jd),se.set(_,V),V}function $e(j,E={}){const _=F(E.jieOnly),J=_?`${j}|jie`:j,V=G.get(J);if(V)return V;const oe=[...me(j-1,_),...me(j,_),...me(j+1,_)];return oe.sort((ie,ue)=>ie.jd-ue.jd),G.set(J,oe),oe}function ze(j){if(typeof j!="string"||j.length<2)return[];const E=H.indexOf(j[0]),_=D.indexOf(j[1]);if(E<0||_<0)return[];const J=m(E,_);if(J<0)return[];const V=Math.floor(J/10)*10;return[D[(V+10)%12],D[(V+11)%12]]}function i(j,E){let _=null;for(const J of j)if(J.index%2===0)if(J.jd<=E)_=J;else break;return _}function b(j,E){for(const _ of j)if(_.index%2===0&&_.jd>E)return _;return null}function Y(j){const E=x(j),_=J=>String(J).padStart(2,"0");return`${E.year}-${_(E.month)}-${_(E.day)} ${_(E.hour)}:${_(E.minute)}`}function K(){return[$.stats(),se.stats(),G.stats()]}return{STEMS:H,BRANCHES:D,TERM_NAMES:q,termLongitude:z,toJDN:I,fromJDN:k,sexagenaryIndex:m,ganzhiName:f,dayGanzhiIndex:L,sunLongitude:A,deltaTSeconds:s,OFFSET_MODERN:c,OFFSET_BEIJING_LOCAL:u,CUTOVER_JD:N,localOffsetFor:S,termInstantJd:y,jdToParts:x,partsToJd:M,equationOfTime:v,termWindow:$e,xunKongOf:ze,previousJie:i,nextJie:b,formatJd:Y,cacheMetrics:K}})(),R.lunar=(function(){const{toJDN:P,jdToParts:B,termInstantJd:F,deltaTSeconds:H,localOffsetFor:D}=R.calendar||{},q=29.530588861,z=245155009766e-5,I=Math.PI/180;function k(s){const c=s/1236.85,u=z+q*s+15437e-8*c*c-15e-8*c*c*c+73e-11*c*c*c*c,N=1-.002516*c-74e-7*c*c,S=(2.5534+29.1053567*s-14e-7*c*c-11e-8*c*c*c)*I,$=(201.5643+385.81693528*s+.0107582*c*c+1238e-8*c*c*c-58e-9*c*c*c*c)*I,g=(160.7108+390.67050284*s-.0016118*c*c-227e-8*c*c*c+11e-9*c*c*c*c)*I,o=(124.7746-1.56375588*s+.0020672*c*c+215e-8*c*c*c)*I,d=-.4072*Math.sin($)+.17241*N*Math.sin(S)+.01608*Math.sin(2*$)+.01039*Math.sin(2*g)+.00739*N*Math.sin($-S)-.00514*N*Math.sin($+S)+.00208*N*N*Math.sin(2*S)-.00111*Math.sin($-2*g)-57e-5*Math.sin($+2*g)+56e-5*N*Math.sin(2*$+S)-42e-5*Math.sin(3*$)+42e-5*N*Math.sin(S+2*g)+38e-5*N*Math.sin(S-2*g)-24e-5*N*Math.sin(2*$-S)-17e-5*Math.sin(o)-7e-5*Math.sin($+2*S)+4e-5*Math.sin(2*$-2*g)+4e-5*Math.sin(3*S)+3e-5*Math.sin($+S-2*g)+3e-5*Math.sin(2*$+2*g)-3e-5*Math.sin($+S+2*g)+3e-5*Math.sin($-S+2*g)-2e-5*Math.sin($-S-2*g)-2e-5*Math.sin(3*$+S)+2e-5*Math.sin(4*$),h=u+d-H(2e3+c*100)/86400;return h+D(h)}function m(s){return Math.floor(s+.5)}function f(s){return Math.round((s+.5-z)/q)}function L(s,c,u){for(let N=s-1;N<=s+1;N++)for(let S=1;S<24;S+=2){const $=F(N,S),g=m($);if(g>=c&&g<u)return{index:S,jd:$}}return null}function A(s,c,u){const N=P(s,c,u),S=m(F(s,23)),$=N<S?s-1:s,g=m(F($,23));let o=f(g);for(;m(k(o))>g;)o--;for(;m(k(o+1))<=g;)o++;const d=m(F($+1,23));let h=o;for(;m(k(h+1))<=d;)h++;const y=h-o;let x=-1;if(y===13)for(let G=1;G<=y;G++){const se=m(k(o+G-1)),C=m(k(o+G));if(!L($,se,C)){x=G;break}}let M=11,v=!1;for(let G=1;G<=15;G++){const se=m(k(o+G-1)),C=m(k(o+G)),Q=L($,se,C),me=G===x;if(N>=se&&N<C){const $e=B(k(o+G-1)),ze=me?(M+10)%12+1:M;return{year:$,lunarYear:v?$+1:$,month:ze,day:N-se+1,isLeap:me,monthStart:`${$e.year}-${String($e.month).padStart(2,"0")}-${String($e.day).padStart(2,"0")}`,hasZhongQi:!!Q}}me||(M=M%12+1,M===1&&(v=!0))}throw new Error(`农历换算失败:${s}-${c}-${u}`)}return{SYNODIC:q,newMoonJd:k,dayNumberOf:m,solarToLunar:A}})(),R.geo=(function(){const{bool:P}=R.bool||{},B=`
4
4
  北京 116.41 39.90;上海 121.47 31.23;天津 117.20 39.13;重庆 106.55 29.56
5
5
  广州 113.26 23.13;深圳 114.06 22.55;珠海 113.58 22.27;东莞 113.75 23.02;佛山 113.12 23.02
6
6
  汕头 116.68 23.35;中山 113.39 22.52;惠州 114.42 23.11;江门 113.08 22.58;湛江 110.36 21.27
@@ -67,80 +67,80 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.constitution.js
67
67
  贵港 109.60 23.11;贺州 111.57 24.40;来宾 109.23 23.75;崇左 107.36 22.40
68
68
  海口 110.20 20.04;三亚 109.51 18.25;儋州 109.58 19.52;琼海 110.47 19.26
69
69
  香港 114.17 22.32;澳门 113.55 22.20;台北 121.52 25.03;高雄 120.31 22.63;台中 120.68 24.14
70
- `,F={河北:"石家庄",山西:"太原",内蒙古:"呼和浩特",辽宁:"沈阳",吉林:"长春",黑龙江:"哈尔滨",江苏:"南京",浙江:"杭州",安徽:"合肥",福建:"福州",江西:"南昌",山东:"济南",河南:"郑州",湖北:"武汉",湖南:"长沙",广东:"广州",广西:"南宁",海南:"海口",四川:"成都",贵州:"贵阳",云南:"昆明",西藏:"拉萨",陕西:"西安",甘肃:"兰州",青海:"西宁",宁夏:"银川",新疆:"乌鲁木齐",台湾:"台北"},H={石家庄:[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]},Y=(()=>{const A={};for(const s of B.trim().split(`
71
- `))for(const c of s.split(";")){const u=c.trim().split(/\s+/);if(u.length!==3)continue;const[N,j,$]=u;A[N]={lon:Number(j),lat:Number($)}}for(const[s,[c,u]]of Object.entries(H))A[s]||(A[s]={lon:c,lat:u});return A})(),q=/[省区路街道巷弄号村镇乡组队]/,z={中山区:{city:"大连"},朝阳区:{city:"北京",byProvince:{吉林:"长春",辽宁:"朝阳"}}};function I(A){const s=String(A||"").trim();if(!s)return null;const c=Number(s);if(Number.isFinite(c)&&/^-?\d+(\.\d+)?$/.test(s)&&c>=60&&c<=150)return{lon:c,lat:null,matched:`${c}°E`,level:"经度",note:"按你输入的经度计算"};const u=s.replace(/\s/g,""),N=Object.keys(Y).sort((g,o)=>o.length-g.length),j=[];for(const g of N)for(let o=u.indexOf(g);o>=0;o=u.indexOf(g,o+g.length)){const h=u.charAt(o+g.length);q.test(h)||j.push({name:g,at:o,after:h,explicit:h==="市"?1:0})}if(j.sort((g,o)=>o.explicit-g.explicit||g.at-o.at),j.length){const g=j[0],o=Y[g.name];return g.after==="县"?{lon:o.lon,lat:o.lat,matched:`${g.name}县`,level:"区县",note:`「${g.name}县」按 ${g.name} 城区估算(约 ${o.lon}°E)`}:{lon:o.lon,lat:o.lat,matched:g.name,level:"地级市",note:`按 ${g.name} 估算(约 ${o.lon}°E)`}}for(const[g,o]of Object.entries(z)){if(!u.includes(g))continue;let h=o.city;for(const[y,x]of Object.entries(o.byProvince||{}))if(u.includes(y)){h=x;break}const d=Y[h];if(d)return{lon:d.lon,lat:d.lat,matched:h,level:"区县",note:`「${g}」按 ${h} 估算(约 ${d.lon}°E)`}}const $=N.find(g=>u.includes(`${g}路`)||u.includes(`${g}街`));if($)return{lon:null,lat:null,matched:null,level:"未匹配",note:`「${$}路」是全国常见的路名,无法确定城市;请补上城市(如「厦门市${$}路」)或直接填经度`};for(const[g,o]of Object.entries(F)){const h=u.indexOf(g);if(h<0)continue;const d=u.charAt(h+g.length);if(d==="区"||d==="县")continue;const y=Y[o]||{lon:H[o][0],lat:H[o][1]};return{lon:y.lon,lat:y.lat,matched:o,level:"省会",note:`未匹配到具体城市,按 ${g} 省会 ${o} 估算(约 ${y.lon}°E)`}}return{lon:null,lat:null,matched:null,level:"未匹配",note:`没查到「${s}」,可改填经度(如 116.4)`}}const k=/(区|县|镇|乡|村|小区|街道|路|号|巷|弄|组|队)/,m="dsh-metaphysics (+https://github.com/xuanfu-web/dsh-metaphysics)";async function f(A,{timeoutMs:s=2500}={}){if(typeof fetch!="function")return null;let c=null;try{const u=typeof AbortController=="function"?new AbortController:null;u&&(c=setTimeout(()=>u.abort(),s));const N="https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&accept-language=zh-CN&countrycodes=cn&q="+encodeURIComponent(A),j=await fetch(N,{signal:u?u.signal:void 0,headers:{"User-Agent":m}});if(!j||!j.ok)return null;const $=await j.json();if(!Array.isArray($)||$.length===0)return null;const g=$[0],o=Number(g.lon),h=Number(g.lat);return Number.isFinite(o)?{lon:o,lat:h,matched:g.display_name,level:"在线",note:`在线解析:${g.display_name}`}:null}catch{return null}finally{c&&clearTimeout(c)}}async function _(A,s={}){const c=I(A),u=String(A||"").trim();if(!u||!P(s.online)||c&&typeof c.lon=="number"&&!k.test(u))return c;const j=await f(u,s);return j?{...j,local:c&&c.lon!=null?c:null}:c&&typeof c.lon=="number"?{...c,onlineFailed:!0,note:`${c.note}(联网解析失败或超时,已退回内置坐标表)`}:{...c,onlineFailed:!0}}return{CITIES:Y,PROVINCES:F,resolveAddress:I,geocodeAddress:_}})(),R.random=(function(){function P(z){const I=Number(z),k=I>>>0,m=Math.floor(Math.abs(I)/4294967296)>>>0,f=Math.round((I-Math.trunc(I))*4294967296)>>>0;let _=(k^Math.imul(m+1,2246822507)^f)>>>0;return _||(_=2654435769),function(){_=_+1831565813>>>0;let s=_;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}function B(){const z=globalThis.crypto;if(!z||typeof z.getRandomValues!="function")return Math.random;const I=128,k=new Uint32Array(I);let m=I;const f=()=>(m>=I&&(z.getRandomValues(k),m=0),k[m++]/4294967296);return f.source="crypto",f}const F=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/,H=z=>{if(typeof z=="number")return Number.isFinite(z)?z:NaN;if(typeof z=="string"){const I=z.trim();if(I!==""&&F.test(I))return Number(I)}return NaN};function Y(z){if(z==null||z==="")return B();const I=H(z);return Number.isFinite(I)?P(I):B()}function q(z){return z==null||z===""?!0:Number.isFinite(H(z))}return{mulberry32:P,randomOf:Y,isSeed:q}})(),R.dst=(function(){const{daysInMonth:P}=R.validate||{},B={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"]},F=(z,I,k)=>z*1e4+I*100+k;function H(z){const I=B[z.year];if(!I)return!1;const[k,m,f]=I[0].split("-").map(Number),[_,A,s]=I[1].split("-").map(Number),c=F(z.year,z.month,z.day);if(c<F(k,m,f)||c>F(_,A,s))return!1;const u=z.hour*60+(z.minute||0);return!(c===F(k,m,f)&&u<120||c===F(_,A,s)&&u>=120)}function Y(z){const I=B[z.year];if(!I)return null;const[k,m,f]=I[0].split("-").map(Number),[_,A,s]=I[1].split("-").map(Number),c=F(z.year,z.month,z.day),u=z.hour*60+(z.minute||0);return c===F(k,m,f)&&u>=120&&u<180?"gap":c===F(_,A,s)&&u>=60&&u<120?"twice":null}function q(z){const I=z.minute||0;if(!H(z))return{year:z.year,month:z.month,day:z.day,hour:z.hour,minute:I,applied:!1,note:null};let{year:k,month:m,day:f,hour:_}=z;_-=1,_<0&&(_+=24,f-=1,f<1&&(m-=1,m<1&&(m=12,k-=1),f=P(k,m)));const A=Y(z);return{year:k,month:m,day:f,hour:_,minute:I,applied:!0,note:`检出自 ${B[z.year][0]} 至 ${B[z.year][1]} 的中国夏令时:出生钟面时间已减 1 小时校正`+(A==="gap"?";这一天 02:00–03:00 钟表直接跳过,所给钟面时间在当年并不存在——这里按「拨快后的读数」回退一小时,若登记的本是标准时间,请传 dst:false 重排。":A==="twice"?";这一天 01:00–02:00 因回拨走了两遍,同一钟面时间对应两个真实时刻——这里按夏令时的那一遍(回退一小时)取。":"")}}return{DST_SPANS:B,inDstSpan:H,dstAmbiguity:Y,applyDst:q}})(),R.classics=(function(){const P={ziping:{name:"子平真诠",author:"清·沈孝瞻",base:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/"},ditian:{name:"滴天髓",author:"明·京图(通行本)",base:"https://www.diancang.xyz/xuanxuewushu/ditiansui/"},sanming:{name:"三命通会",author:"明·万民英",base:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/"}},B=[{id:"zp-yongshen",book:"ziping",chapter:"八、论用神",scene:"用神",tags:[],quote:"八字用神,专求月令,以日干配月令地支,而生克不同,格局分焉。财官印食,此用神之善而顺用之者也;煞伤劫刃,用神之不善而逆用之者也。",plain:"用神从月令里找:财、官、印、食四吉神顺用(生之护之),煞、伤、劫、刃四凶神逆用(制之化之)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53628.html"},{id:"zp-zhenguan",book:"ziping",chapter:"三十一、论正官",scene:"格局",tags:["正官"],quote:"以刑冲破害为忌,则以生之护之为喜矣。存其喜而去其忌则贵,而贵之中又有高低者,何也?",plain:"正官格最忌刑冲破害,喜财生官、印护官;去忌存喜才谈得上贵,贵的层次还要看财印是否并透、有无伤官七煞混杂。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53651.html"},{id:"zp-cai",book:"ziping",chapter:"三十三、论财",scene:"格局",tags:["财","正财","偏财"],quote:"财为我克,使用之物也,以能生官,所以为美。为财帛,为妻妾,为才能,为驿马,皆财类也。",plain:"财是我所克、能为我用之物,因能生官而美;它同时代表钱财、配偶、才能、走动,不只「钱」一项。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53653.html"},{id:"zp-yin",book:"ziping",chapter:"三十五、论印绶",scene:"格局",tags:["印"],quote:"印绶喜其生身,正偏同为美格,故财与印不分偏正,同为一格而论之。",plain:"印能生身,正印偏印都算美格,不分偏正而论;印格的关键在身印强弱与官杀、食伤、财的配合。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53655.html"},{id:"zp-shishen",book:"ziping",chapter:"三十七、论食神",scene:"格局",tags:["食神"],quote:"食神本属泄气,以其能生正财,所以喜之。故食神生财,美格也。财要有根,不必偏正叠出,如身强食旺而财透,大贵之格。",plain:"食神本是泄气,可贵在能生财;食神生财要财有根,身强、食旺、财透三者齐,格局才大。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53657.html"},{id:"zp-pianguan",book:"ziping",chapter:"三十九、论偏官",scene:"格局",tags:["七杀","偏官"],quote:"煞以攻身,似非美物,百大贵之格,多存七煞。盖控制得宜,煞为我用,如大英雄大豪杰,似难驾驭,而处之有方,则惊天动地之功,忽焉而就。",plain:"七煞攻身,看着不美,但大贵之格多有七煞——能控制住就为我所用,像驾驭豪杰,处之有方就能成大事。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53659.html"},{id:"zp-shangguan",book:"ziping",chapter:"四十一、论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽非吉神,实为秀气,故文人学士,多于伤官格内得之。而夏木见水,冬金见火,则又为秀之尤秀者也。",plain:"伤官不是吉神,却是秀气所在,文人多出伤官格;夏木得水、冬金得火,是秀气里更秀的两种。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53661.html"},{id:"zp-yangren",book:"ziping",chapter:"四十三、论阳刃",scene:"格局",tags:["劫财","阳刃"],quote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之,故为阳刃。不曰劫而曰刃,劫之甚也。刃宜伏制,官煞皆宜,财印相随,尤为贵显。",verifiedQuote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之",variantNote:"典藏网此页把「故为阳刃」刻作「故为旭刃」,与通行本异文;前段仍可逐字核验",plain:"阳刃是劫财之极(只有五阳干有),宜用官煞制伏;财印相随而不相碍,格局更显。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53663.html"},{id:"zp-lujie",book:"ziping",chapter:"四十五、论建禄月劫",scene:"格局",tags:["比肩","建禄","月劫"],quote:"故建禄与月劫,可同一格,不必加分,皆以透干支,别取财官煞食为用。",plain:"建禄、月劫同看一格,月令本身不算用神,要另看透出的财官煞食取用。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53665.html"},{id:"zp-qihou",book:"ziping",chapter:"十四、论用神配气候得失",scene:"调候",tags:[],quote:"论命惟以月令用神为主,然亦须配气候而互参之。譬如英雄豪杰,生得其时,自然事半功倍;遭时不顺,虽有奇才,成功不易。",plain:"月令用神为主,但必须配气候参看;同样的格局,生在得时的气候里事半功倍,逆着气候就费劲。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53634.html"},{id:"zp-chengbai",book:"ziping",chapter:"九、论用神成败救应",scene:"格局",tags:[],quote:"成中有败,必是带忌;败中有成,全凭救应。",plain:"成格不等于一路顺:成中带忌(官逢财又逢伤、官被合之类)就打了折;败格也未必无救——印来解伤、合来清煞,败中还能转成。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53629.html"},{id:"zp-zaji",book:"ziping",chapter:"十六、论杂气如何取用",scene:"用神",tags:[],quote:"何谓透干?如甲生辰月,透戊则用偏财,透癸则用正印,透乙则用月劫是也。何谓会支?如甲生辰月,逢申与子会局,则用水印是也。一透则一用,兼透则兼用,透而又会,则透与会并用。",plain:"四墓(辰戌丑未)所藏不止一气,所以叫杂气:取用先看哪一藏干透到天干,透一个用一个;没有透干,再看地支有没有与月支会成三合局,会成什么局就取局中那一气。透干与会支同时成立时两样并用。原文对「兼透」只给原则,没有给取舍次序。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53636.html"},{id:"zp-bianhua",book:"ziping",chapter:"十、论用神变化",scene:"格局",tags:[],quote:"故若丁生亥月,本为正官,支全卯未,则化为印。己生申月,本属伤官。藏庚透壬,则化为财。凡此之类皆用神之变化也。",plain:"用神本从月令取,但月令藏干不一:丁生亥月本为正官,支会卯未就化为印;己生申月本属伤官,庚藏壬透就化为财。起点相同,合化一变,取用也跟着变(原文只说变化之由,不断定某盘必化)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53630.html"},{id:"dt-hannuan",book:"ditian",chapter:"通神论·寒暖",scene:"调候",tags:[],quote:"天道有寒暖,生育万物,人道行之,不可过也。",plain:"天有寒暖才能生养万物,人命里寒暖也不能过——过寒过热都要调。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zaoshi",book:"ditian",chapter:"通神论·燥湿",scene:"调候",tags:[],quote:"地道有燥湿,生成品汇,人道得之,不可偏也。",plain:"地有燥湿才有品类生成,人命得燥湿之气也不能偏。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shuaiwang",book:"ditian",chapter:"通神论·衰旺",scene:"调候",tags:[],quote:"能知旺衰之真机,其于三命之奥,思过半矣。",plain:"真正看懂旺衰的机关,命理之奥就过了一半——旺衰不是数个数,要看真机。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zhonghe",book:"ditian",chapter:"通神论·中和",scene:"调候",tags:[],quote:"既识中和之正理,而于五行之妙,有全能焉。",plain:"懂得中和的道理,五行的妙处就都在其中了。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-guansha",book:"ditian",chapter:"通神论·官杀",scene:"十神",tags:["正官","七杀"],quote:"官杀混杂来问我,有可有不可。",plain:"官杀混杂不是一律不好,要看能不能去留取清。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shangguan",book:"ditian",chapter:"通神论·伤官",scene:"十神",tags:["伤官"],quote:"伤官见官最难辨,可见不可见。",plain:"伤官见官是最难分辨的一条:有的能见,有的不能见,不能一句「伤官见官为祸百端」了事。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-yueling",book:"ditian",chapter:"通神论·月令",scene:"用神",tags:[],quote:"月令乃提纲之府,譬之宅也,人元为用事之神,宅之定向也,不可以不卜。",plain:"月令像宅子,藏干是用事之神,像宅子的朝向,必须细看。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tiyong",book:"ditian",chapter:"通神论·体用",scene:"用神",tags:[],quote:"道有体用,不可以一端论也,要在扶之抑之得其宜。",plain:"体用不能只看一头,关键是扶抑得宜。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-jingshen",book:"ditian",chapter:"通神论·精神",scene:"用神",tags:[],quote:"人有精神,不可以一偏求也,要在损之益之得其中。",plain:"看精神不能偏执一端,要在损益之间求其中。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tongguan",book:"ditian",chapter:"通神论·通关",scene:"用神",tags:[],quote:"关内有织女,关外有牛郎,此关若通也,相邀入洞房。",plain:"两股力隔着一道关相望:一边织女、一边牛郎,中间若有一行能把两边接上(一方生它、它再生另一方),对峙就化成相生。原文只给取象,哪一行为关要按五行生克定。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"smt-zhenguan",book:"sanming",chapter:"卷五·论正官",scene:"格局",tags:["正官"],quote:"正官者,乃甲见辛、乙见庚之例。阴阳配合,相制有用,成其道也。故正官为六格之首,止许一位,多则不宜。",plain:"正官取「克我而阴阳相配」,有制而能成用;六格以正官居首,只宜一位,多见就杂。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7582.html"},{id:"smt-zhengcai",book:"sanming",chapter:"卷六·论正财",scene:"格局",tags:["财","正财"],quote:"正财者,乃甲见己、乙见戊之例。受我克制,为我之妻,譬人娶妻,妻赍财嫁我,我必精神康强,而后可享用,若衰微不振,虽妻财丰厚,但能目视,终不得用。",plain:"正财是我克制之物,古人以「娶妻带财」作比:自身精神康强才受用得起,身弱不振,财再厚也只是看着。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7645.html"},{id:"smt-piancai",book:"sanming",chapter:"卷六·论偏财",scene:"格局",tags:["财","偏财"],quote:"何谓偏财?乃甲见戊、乙见己之例。非妻所带,乃众人之财也。切忌有姊妹兄弟分夺,柱无官星,祸患百出。",plain:"偏财取「我克而阴阳不同」:不是妻家带来的私财,而是众人之财,宜流通不宜独占。原文最忌比肩劫财来分夺,又说柱中无官星则多事(旧说的重话照录,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7650.html"},{id:"smt-yinshou",book:"sanming",chapter:"卷六·论印绶",scene:"格局",tags:["印"],quote:"印绶者,乃五行生我之名。如甲乙在亥子月,丙丁在寅卯月之类,乃我气之源,为生气,为父母,能护我官星,使无伤克",plain:"印是生我之气,像源头与父母:它能护住官星,使官不受伤克;反过来说,印重就怕财来破。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7655.html"},{id:"smt-shishen",book:"sanming",chapter:"卷六·论食神",scene:"格局",tags:["食神"],quote:"凡命遇财煞之地,食神旺相,煞被食制,不敢为祸,财被食生,充裕不竭,故食神一名寿星,一名爵星,良有以也。",plain:"食神旺,一头制煞、一头生财:煞被制住不敢为祸,财被生起不至枯竭;所以食神又叫寿星、爵星。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7663.html"},{id:"smt-shangguan",book:"sanming",chapter:"卷六·论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽凶,乃我所生,自家之物,伤尽则能生财,财旺则能生官,造化展转有情。",plain:"伤官虽称凶,却是我自己生出来的:伤尽(柱中不见官星)反能生财,财旺再生官,辗转还是有情。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7662.html"},{id:"smt-yangren",book:"sanming",chapter:"卷六·论阳刃",scene:"格局",tags:["阳刃","劫财"],quote:"阳者,阴阳之阳,刃者,刀刃之刃,即禄前一位,言旺越其分,故险。",plain:"阳刃指禄前一位,旺过了本分,所以险;甲丙戊庚壬五阳干才有刃,阴干见伤官同论。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7671.html"},{id:"smt-jianlu",book:"sanming",chapter:"卷六·论建禄",scene:"格局",tags:["建禄","比肩","月劫"],quote:"凡命月令建禄,难招祖业,必主平生见财不聚,却病少寿长,行运再见比肩,克妻妨父损子",plain:"月令建禄是日主临官之地,身旺而财官难取:古说难承祖业、见财不聚,但病少寿长;再走比肩运,古书说克妻妨父损子(属于旧说的重话,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7672.html"},{id:"smt-guansha-liu",book:"sanming",chapter:"卷五·官煞去留杂论",scene:"格局",tags:["七杀","偏官"],quote:"凡看去留,要详柱中官煞孰重孰轻,天干透者易去,月支所藏者难去,须伤官食神去官煞之物众而有力,方才去得。",plain:"官煞混见时先比谁重谁轻:天干透出的容易去,月支藏着的难去;用来去官煞的伤官食神要成众、有根有力,才真去得掉。七杀格遇正官混杂,就按这一篇看取舍。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7599.html"},{id:"smt-quzhi",book:"sanming",chapter:"卷六·曲直",scene:"格局",tags:["曲直格","专旺"],quote:"甲乙日得亥卯未局,柱中须有亥字带印为入格,若无亥有卯,止是木之本气,却要见金土为贵,既无亥字,又无金土,则木不秀不实,难以言贵。",plain:"曲直格要木局成方(亥卯未)且带亥字为印,才算入格;只有卯、没有亥,只是木的本气,得另见金土才谈得上贵;两样都没有,木虽旺而无成,难称贵格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7630.html"},{id:"smt-yanshang",book:"sanming",chapter:"卷六·炎上",scene:"格局",tags:["炎上格","专旺"],quote:"丙丁日遇寅午戌局,柱中须有寅字带印为入格,无寅止是九流近贵之命,若火自旺,无亥水相济,不贵。喜东北方运,忌见辰丑戊己,晦火光明,多主眼疾,或患风气,柱有木制成贵,忌水金乡,怕冲。",plain:"炎上格要火局成方(寅午戌)且带寅字为印才入格;无寅只是偏贵的命。火自旺还要一点水相济,过燥不贵;行运喜东北、忌湿土晦火,也怕冲。原文另带「多主眼疾」一句,属于旧说,本插件只记原文、不作健康判断。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7631.html"},{id:"smt-congge",book:"sanming",chapter:"卷六·从革",scene:"格局",tags:["从革格","专旺"],quote:"庚辛日见巳酉丑局,须带丙丁巳午一二位方成其器,但不可火多。如辛巳、辛酉、辛丑三日不喜五月生,被火所伤,宜八月或水土养育食神印绶为吉。",plain:"从革格是金局成方(巳酉丑),但金要火炼才成器:须带丙丁或巳午一二位,火又不能多。辛巳、辛酉、辛丑三日出身在五月(火旺)被伤,原文说宜八月或水土养育。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7632.html"},{id:"smt-runxia",book:"sanming",chapter:"卷六·润下",scene:"格局",tags:["润下格","专旺"],quote:"壬癸日见申子辰全,忌引卯巳死绝之地,三刑四冲之乡,死绝则不流,冲刑则横流,岁运同。或曰水太泛须柱有土神一两位制之,得成堤岸,既有土怕会木为凶,如有木伤土要金印救解,终是一生成败。",plain:"润下格是水局三合全(申子辰),最忌卯巳死绝与三刑四冲:死绝水不流,冲刑水横流,行运也一样看。水太泛要一两位土作堤,有土又怕木来破堤,木伤土再用金印解救——原文把成败条件摊开讲。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7633.html"},{id:"smt-jiasi",book:"sanming",chapter:"卷六·稼穑",scene:"格局",tags:["稼穑格","专旺"],quote:"赋云:戊己忻逢四季,乃为稼穑之名。是戊己生逢季月,喜见木为官,止得一木为妙,木多则土虚,主虚诈为破家不仁之人。",plain:"稼穑格取戊己生于四季月(辰戌丑未)。原文说喜见一木为官,木多则土虚;后半对木多之人的评语是旧说的重话,本插件只照录条件、不拿来评价人。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7634.html"},{id:"smt-congsha",book:"sanming",chapter:"卷五·弃命从煞",scene:"格局",tags:["从杀格"],quote:"《独步》云:弃命从煞,须要会煞从财,忌煞从煞。盖言从煞格,以煞神太重,身无所归,不得已从之,要行煞旺及财乡,四柱无一点比肩印绶方论,如遇运扶身旺,与煞为敌,从煞不专,故为祸患。",plain:"从煞格是煞太重、日主无所归才「弃命」相从:条件是四柱没有一点比肩印绶扶身,行运喜煞旺与财乡;一旦走扶身之运,与煞为敌,就从得不专。本插件只作结构说明,不据此断寿夭。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7598.html"},{id:"smt-congcai",book:"sanming",chapter:"卷六·弃命从财",scene:"格局",tags:["从财格"],quote:"《独步》云:弃命从财,须要会财,若逢根气,命损无猜。假如丁生酉月,柱多庚辛,日干无气,只得弃命相从,运入北方财官旺地,乃为入格,南行灾。",plain:"从财格要财会成局、日干无气;一见根气就破格,原文用「命损无猜」这种重话写明。以丁生酉月、柱多庚辛为例:只能弃命相从,行北方财官旺地为入格,南行则灾。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7652.html"},{id:"smt-suiyun",book:"sanming",chapter:"卷二·总论岁运",scene:"岁运",tags:[],quote:"行运以生月为运元,最怕行运与太岁冲克,若岁运冲月必祸;若岁运与日相对,谓之返吟,岁运压日,谓之伏吟,二者不利六亲,非横破财,不为吉兆。",plain:"大运以生月为起点,最怕与流年(太岁)冲克:原文说岁运冲月为祸,又把「岁运与日柱相对」叫返吟、「岁运压日」叫伏吟。这两句是按「对日柱」说的,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义(本插件取后者);末句「不利六亲、破财」是旧说的重话,只作变动提示,不作断语。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html"},{id:"smt-renyuan",book:"sanming",chapter:"卷二·论人元司事",scene:"人元",tags:[],quote:"故支吕所藏者主命,谓之人元,名为司事之神,以命术言之为月令。如正月建寅,寅中有艮土用事五日,丙火长生五日,甲木二十日;二月建卯,卯中有甲木用事七日,乙木二十三日;",plain:"地支所藏为「人元」,按月令分日轮值。三命通会这一本给的是另一套日数:寅月艮土(戊土)五日、丙火五日、甲木二十日,卯月甲七日、乙二十三日。它与本插件采用的通行 30 日表(寅月戊7丙7甲16,即 7/7/16;卯月甲10乙20,即 10/20)不是同一套分法;两表各照原样并列,本插件仍按通行表给「第几日谁当权」,不改取格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7529.html"}],F=B.reduce((A,s)=>(A[s.id]=s,A),{}),H={正官格:"正官",七杀格:"七杀",偏官格:"偏官",正财格:"正财",偏财格:"偏财",正印格:"印",偏印格:"印",食神格:"食神",伤官格:"伤官",阳刃格:"阳刃",月劫格:"月劫",建禄格:"建禄"},Y={曲直格:"smt-quzhi",炎上格:"smt-yanshang",从革格:"smt-congge",润下格:"smt-runxia",稼穑格:"smt-jiasi",从财格:"smt-congcai",从杀格:"smt-congsha"};function q(A){return F[A]||null}function z(A){return(A&&Array.isArray(A.liunian)?A.liunian:[]).some(u=>u&&u.suiyun&&Array.isArray(u.suiyun.signals)&&u.suiyun.signals.length)?q("smt-suiyun"):null}function I(A){const s=String(A||"");if(H[s])return H[s];const c=s.replace(/格$/,"");return H[c+"格"]||c}function k(A,s){return B.find(c=>c.scene==="格局"&&c.tags.includes(A)&&(!s||c.book===s))||null}function m(A){return A.chapter.replace(/^.*[、·]/,"").replace(/^论/,"")}function f(A,s=5){if(!A)return[];const c=[],u=new Set,N=(O,G)=>{!O||u.has(O.id)||c.length>=s||(u.add(O.id),c.push({...O,why:G}))},j=Array.isArray(A.geju)?A.geju:A.frame&&Array.isArray(A.frame.geju)?A.frame.geju:[],$=j.some(O=>O&&O.kind==="化气格");for(const O of j){if(O&&O.status==="破格"||$&&O&&O.status==="假从")continue;const G=O&&Y[O.name]?q(Y[O.name]):null;G&&N(G,`本盘列有「${O.name}」,故取${P[G.book].name}「${m(G)}」一条`)}for(const O of j){if(!O||O.kind&&O.kind!=="月令格")continue;const G=I(O.name),se=k(G,"ziping")||k(G);se&&N(se,`你的月令格局是「${O.name}」,故取${P[se.book].name}「${m(se)}」一条`);const C=B.find(X=>X.scene==="格局"&&X.tags.includes(G)&&(!se||X.book!==se.book));C&&N(C,`同是「${O.name}」,${P[C.book].name}「${m(C)}」另有取法,可对照读`)}const g=A.climate||A.frame&&A.frame.yongshen&&(A.frame.yongshen.climate||A.frame.yongshen.tiaohou),o=A.frame&&A.frame.yongshen&&A.frame.yongshen.tongguan,h=o&&o.usable?q("dt-tongguan"):null;if(g&&g.kind&&g.kind!=="平和"){const O=!!(g.cold||g.kind.indexOf("寒")>=0),G=!!(g.hot||g.kind.indexOf("热")>=0);N(q(O?"dt-hannuan":"dt-zaoshi"),`本盘气候判为「${g.kind}」,故取${P.ditian.name}寒暖燥湿一条`),h||N(q("zp-qihou"),"气候与月令用神要互参,故取子平真诠「用神配气候」一条"),G&&N(q("dt-hannuan"),"本盘偏热,寒暖一条正对")}h&&N(h,`本盘忌${o.foe}克用${o.use},局中${o.bridge}${o.weight}分可作通关,故取${P.ditian.name}「通关」一条`);const d=j.find(O=>O&&O.kind==="化气格"),y=j.find(O=>O&&O.kind==="组合"),x=A.monthBranch||A.frame&&A.frame.monthBranch||A.pillars&&A.pillars.month&&A.pillars.month.branch,M=["辰","未","戌","丑"].includes(x);return d?N(q("zp-bianhua"),`本盘列有「${d.name}」:用神由月令合化而变,总纲一位改取${P.ziping.name}论用神变化`):M?N(q("zp-zaji"),`月令${x}属四墓杂气,取用先看透干、再看会支,总纲一位取${P.ziping.name}论杂气如何取用`):y?N(q("zp-chengbai"),`本盘另有「${y.name}」组合:成格还要看带忌与救应,总纲一位改取${P.ziping.name}论用神成败救应`):N(q("zp-yongshen"),"用神从月令取、四吉顺用四凶逆用,是通用总纲"),c}function _(A){return!A||!A.length?"":A.map(s=>`《${P[s.book].name}·${s.chapter}》「${s.quote}」`).join(`
72
- `)}return{CLASSIC_BOOKS:P,CLASSICS:B,classicOf:q,suiyunClassicOf:z,classicsFor:f,classicsText:_}})(),R.constitution=(function(){const{fail:P}=R.fail||{},B=5,F=[{key:"pinghe",name:"平和质",oneLine:"阴阳气血相对匀,吃得下、睡得着、恢复快。",trait:"精力够用,耐受冷热,情绪起伏不大,睡醒后能缓过来。",tendency:"这种底子最省心,重点是别自己把它折腾坏。",care:["食:什么都能吃一点,别追一个味道到底;七分饱比补品有用。","起居:睡点固定比睡够时长更关键,熬夜是最快的消耗方式。","动:每周三四次微汗即可,不必练到力竭。","情志:留一点「什么都不干」的时间,别把日程排满。"],questions:["你精力充沛,不太容易觉得累","你能耐受冷也能耐受热,换季不太难受","你胃口稳定,吃完不胀不反酸","你睡得踏实,醒来精神能回来","你情绪起伏不大,遇事能较快平复"]},{key:"qixu",name:"气虚质",oneLine:"气不够用:容易累、说话没劲、稍动就出汗。",trait:"容易疲乏、气短、说话声音低,活动后出汗多,容易感冒。",tendency:"不是懒,是电量掉得快;硬撑只会更空。",care:["食:主食别减太狠,山药、小米、黄豆这类平补的东西比猛补更合适。","起居:宁可早睡半小时,也别靠咖啡顶着;午间闭眼十分钟有用。","动:散步、八段锦这类「不喘」的运动优先,别一上来就高强度。","情志:少做长时间的强撑式社交,累了就直说。"],questions:["你容易疲乏,休息后也不太容易缓过来","你说话声音偏低,说久了觉得没气","你稍一活动就比别人容易出汗","你容易感冒,或者感冒后拖得久","你吃完饭容易腹胀、消化慢"]},{key:"yangxu",name:"阳虚质",oneLine:"火力不足:怕冷、手脚凉、喜欢热的。",trait:"畏寒怕冷、手脚发凉,吃凉的容易不舒服,大便偏稀,精神偏静。",tendency:"不是矫情,是产热不够;冷饮和空调直吹对这个体质最伤。",care:["食:热的、熟的优先;姜、羊肉、桂圆可以吃,但别一顿猛补。","起居:腰腹和脚要保暖,睡前泡脚比吃补药直接。","动:白天动起来产热,晒背十分钟比闷在屋里强。","情志:冬天与阴雨天情绪容易低,把户外时间挪到中午。"],questions:["你比一般人怕冷,别人不觉得冷时你已经要加衣服","你的手脚常年偏凉","你喝冷饮或吃凉的东西后容易不舒服","你大便偏稀,或者一受凉就腹泻","你精神偏静,不太想动"]},{key:"yinxu",name:"阴虚质",oneLine:"水不够:口干、手心热、睡不沉。",trait:"口燥咽干、手足心热、容易上火、睡浅多梦、大便偏干。",tendency:"不是火气大,是水少;越熬夜越明显。",care:["食:银耳、百合、梨、黑芝麻这类润的;辛辣烧烤少碰。","起居:熬夜对这个体质伤害最直接,十一点前躺下比什么方子都强。","动:别在正午暴晒下猛练,选傍晚、选温和的。","情志:容易急、容易烦,发现自己在赶时间就先停三分钟。"],questions:["你常觉得口干、咽干,想喝水","你手足心发热,或者下午容易烘热","你容易上火,口腔溃疡或脸上起东西","你睡得不沉,多梦,容易醒","你容易大便干结,排便不太顺畅"]},{key:"tanshi",name:"痰湿质",oneLine:"水湿停着走不动:身重、腹胀、容易困。",trait:"身体沉重、腹部松软肥满、容易困倦、口中黏腻、痰多。",tendency:"不是吃太多,是运化不动;久坐加甜腻会加重。",care:["食:少甜少油少夜宵;薏米、赤小豆、冬瓜这类利湿的可以常吃。","起居:别吃完就躺;房间保持干燥通风。","动:出汗是重点,快走、跳绳这类能真出汗的优先。","情志:困倦时容易拖,把要紧事放在上午做。"],questions:["你常觉得身体沉重、不清爽","你腹部松软,容易胀","你容易困倦,睡够了也昏沉","你口中黏腻,或者痰偏多","你脸上或头发容易出油"]},{key:"shire",name:"湿热质",oneLine:"又湿又热:脸油、口苦、容易长东西。",trait:"面垢油光、容易生痤疮、口苦口干、大便黏滞、小便偏黄。",tendency:"不是「火大」这么简单,湿裹着热,清得太猛反而伤脾。",care:["食:少酒少辣少油炸;绿豆、冬瓜、苦瓜可以吃,但别长期只吃寒凉。","起居:别熬夜加夜宵,这两样凑一起最容易出湿热。","动:规律出汗,运动后及时擦干换衣。","情志:急躁时先降一件事的优先级,别同时开五个头。"],questions:["你脸上或头皮容易出油","你容易长痘、长疖子或起湿疹","你常觉得口苦或口干","你大便黏滞,不容易冲干净","你的小便颜色偏黄、量偏少"]},{key:"xueyu",name:"血瘀质",oneLine:"血行不畅:肤色暗、易有瘀青、痛处固定。",trait:"面色偏暗、口唇偏紫、容易出现瘀斑、身体某处固定刺痛。",tendency:"久坐不动和长期受寒是两大来源。",care:["食:山楂、黑木耳、玫瑰花这类活血的可以常吃;经期量多时别过量。","起居:别久坐,每小时起来走两分钟。","动:有氧为主,练到微微出汗;拉伸比猛练更对症。","情志:闷着不说话最容易瘀,找个人把话说完。"],questions:["你面色或口唇偏暗、偏紫","你身上容易出现瘀青,磕一下就好久不退","你身体某处有固定的刺痛或胀痛","你皮肤偏干,或者容易起红血丝","你记性下降,或者常常觉得「脑子转不动」"]},{key:"qiyu",name:"气郁质",oneLine:"气堵着不顺:胸闷、爱叹气、情绪闷。",trait:"情绪低沉、容易紧张焦虑、胸闷叹气、咽部有异物感、睡不安稳。",tendency:"不是想太多,是气机不通;长期憋着会连带影响睡眠和胃口。",care:["食:少食多餐,别用吃东西压情绪;玫瑰花、陈皮、佛手可以泡水。","起居:把「必须做」的事减到三件以内,留出空档。","动:唱歌、快走、拉伸这类能「把气呼出去」的最有用。","情志:写下来比在脑子里绕有效,哪怕只写三行。"],questions:["你常觉得闷闷不乐,情绪提不起来","你容易紧张、焦虑,或者心里放不下事","你常叹气,觉得胸口不畅","你咽喉像有东西堵着,吞不下也吐不出","你睡不安稳,容易醒或者多梦"]},{key:"tebing",name:"特禀质",oneLine:"对外界刺激反应大:过敏、易起反应。",trait:"容易过敏(鼻炎、皮肤、食物)、对季节与气味敏感、易起荨麻疹。",tendency:"不是体质弱,是反应阈值低;避开诱因比「增强体质」更直接。",care:["食:把自己的过敏原记下来,比记一堆「该吃什么」有用。","起居:换季前把床品洗晒一遍,花粉季回家先洗脸。","动:室内温和运动为主,避开花粉浓度高的时段户外跑。","情志:反复发作容易烦,把「避免诱因」当成日常动作而不是任务。"],questions:["你容易打喷嚏、流清涕,或者鼻子痒","你皮肤容易起荨麻疹、湿疹或红疹","你对某些食物或药物有过敏反应","你对季节变化、气味或灰尘特别敏感","你换环境后容易不舒服(比如新房间、新城市)"]}],H=F.flatMap(m=>m.questions.map((f,_)=>({i:m.key+"-"+(_+1),key:m.key,name:m.name,text:f}))),Y=[{v:1,label:"没有"},{v:2,label:"很少"},{v:3,label:"有时"},{v:4,label:"经常"},{v:5,label:"总是"}];function q(m,f){return Math.round((m-f)/(f*4)*1e3)/10}function z(m,f){return f?m>=60?"是":m>=50?"倾向是":"否":m>=40?"是":m>=30?"倾向是":"否"}function I(){return{system:"constitution",paper:!0,total:H.length,scaleCount:F.length,itemsPerScale:B,scale:Y,scales:F.map(m=>({key:m.key,name:m.name,oneLine:m.oneLine,from:H.findIndex(f=>f.key===m.key)})),questions:H.map((m,f)=>({no:f+1,key:m.key,name:m.name,text:m.text})),howto:"按最近一年的真实感受给每题打 1–5 分(1 没有 / 2 很少 / 3 有时 / 4 经常 / 5 总是),拿不准的题传 null 跳过;把分数按题目顺序填成 answers 数组再调一次。",note:"九种体质各 5 题,共 45 题。这是按通行标准结构做的简化问卷,不是量表原件;结果只作自我观察的参照。"}}function k(m){const f=m&&Array.isArray(m.answers)?m.answers:null;if(!f)throw P("E_INPUT","体质判定需要 answers(按题目顺序的 1–5 分);先不带 answers 调一次拿问卷");const _=H.length;if(f.length!==_)throw P("E_INPUT",`answers 要 ${_} 个(九种体质各 5 题),收到 ${f.length} 个;跳过的题传 null,不要缩短数组`);const A=f.map((X,me)=>{if(X==null)return null;const $e=Number(X);if(!Number.isInteger($e)||$e<1||$e>5)throw P("E_INPUT",`第 ${me+1} 题的分数要是 1–5 的整数或 null,收到「${String(X).slice(0,16)}」`);return $e}),s=A.filter(X=>X!==null).length;if(!s)throw P("E_INPUT","answers 全为 null:至少答几题才能判体质,否则每种都是同一个分数");const c=F.map(X=>{const me=[];H.forEach((b,D)=>{b.key===X.key&&me.push(D)});const $e=me.map(b=>A[b]).filter(b=>b!==null),ze=me.reduce((b,D)=>b+(A[D]===null?3:A[D]),0),a=q(ze,me.length);return{key:X.key,name:X.name,oneLine:X.oneLine,trait:X.trait,tendency:X.tendency,care:X.care.slice(),answered:$e.length,skipped:me.length-$e.length,raw:ze,max:me.length*5,converted:a,level:z(a,X.key==="pinghe")}}),u=c.find(X=>X.key==="pinghe"),N=c.filter(X=>X.key!=="pinghe").slice().sort((X,me)=>me.converted-X.converted),j=N.map(X=>X.converted),$=j.length?Math.max(...j):0;let g=u.level;u.converted>=60&&($<30?g="是":$<40?g="基本是":g="否");const o={...u,level:g},h=N.find(X=>X.level==="是")||N[0],d=N.some(X=>X.level==="是"||X.level==="倾向是"),y=g==="是"||g==="基本是",x=y&&!N.some(X=>X.level==="是")?o:h,M=N.find(X=>X.key!==x.key&&X.converted>=30)||null,O=N.filter(X=>X.level==="是"&&X.key!==x.key&&(!M||X.key!==M.key)).map(X=>X.name),G=A.filter(X=>X!==null),se=G.length>=10&&new Set(G).size===1,C=x.key==="pinghe"?o:x;return{system:"constitution",meta:{answered:s,total:_,scaleCount:F.length,itemsPerScale:B,scale:Y},scales:c.map(X=>X.key==="pinghe"?{...X,level:g}:X),primary:{key:C.key,name:C.name,converted:C.converted,level:C.level,oneLine:C.oneLine,trait:C.trait,tendency:C.tendency},secondary:M?{key:M.key,name:M.name,converted:M.converted,level:M.level}:null,mingled:O,pinghe:{converted:u.converted,level:g},balanced:y&&!N.some(X=>X.level==="是"),hasTendency:d,flat:se,care:C.care.slice(),top:N.slice(0,3).map(X=>({name:X.name,converted:X.converted,level:X.level})),note:"九种体质各 5 题的简化问卷,转化分按 [(原始分 − 题数) / (题数 × 4)] × 100 换算;偏颇质 ≥40 判「是」、30–39 判「有倾向」,平和质要 ≥60 且其余八种都低才成立。体质是长期倾向,不是当下病名;有具体不适请就医,这份结果不与八字、星座互证。"+(se?" 本次每题都选了同一个选项,问卷对你的区分度不足,主次体质仅供参考。":"")}}return{CONSTITUTIONS:F,QUESTIONS:H,SCALE_OPTIONS:Y,constitutionPaper:I,buildConstitution:k}})(),R.followup=(function(){const{ZIWEI_STARS:P}=R["interpret-data"]||{},B=[{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:["出行","搬家","旅行","出国","迁","远行"]}],F={career:"官禄",wealth:"财帛",love:"夫妻",health:"疾厄",study:"官禄",travel:"迁移",overall:"命宫"},H=(u,N)=>{const j=String(u).match(/(20\d{2})\s*年?/);if(j)return Number(j[1]);const $=Array.isArray(N.liunian)&&N.liunian[0]?Number(N.liunian[0].year):null;return $?/明年/.test(u)?$+1:/后年/.test(u)?$+2:/去年/.test(u)?$-1:/今年|本年/.test(u)?$:null:null},Y=u=>B.find(N=>N.words.some(j=>String(u).includes(j)))||null;function q(u,N){const j=H(N,u),$=Y(N),g=Array.isArray(u.liunian)?u.liunian:[],o=Array.isArray(u.dayun?.list)?u.dayun.list:[],h=g.map(d=>d.year);if(j&&!g.some(d=>Number(d.year)===j))return{ok:!1,year:j,topic:$,answer:`这一盘已排的流年范围是 ${h[0]}–${h[h.length-1]},没有 ${j} 年。可以把问题改到范围内,或用 asOf 指定你想看的年份重新排盘。`,evidence:[`已排流年:${h.join("、")}`],confidence:"弱"};if(j){const d=g.find(se=>Number(se.year)===j),y=o.find(se=>Number(se.startAge)<=Number(d.age)&&Number(d.age)<=Number(se.startAge)+9)||null,x=d.luck?.tier||"平",M=(d.luck?.reasons||[]).slice(0,3),O=(d.relations||[]).join("、"),G=$?I(u,$.key):"";return{ok:!0,year:j,topic:$,answer:`${j} 年(${d.ganzhi})流年,十神为${d.stemTenGod||"—"},档位「${x}」;所行大运 ${y?`${y.ganzhi}(${y.luck?.tier||"平"})`:"未取到"}。${M.length?`理由:${M.join(",")}。`:""}${O?`与该年地支相关的原局关系:${O}。`:""}${G}`,evidence:[`流年 ${d.year} ${d.ganzhi}·${d.stemTenGod||""}·${x}`,y?`大运 ${y.ganzhi}·${y.luck?.tier||"平"}`:"",O?`原局关系 ${O}`:"",$?`问题方向:${$.label}`:""].filter(Boolean),confidence:y&&M.length?"强":"中"}}if($){const d={wealth:"overall",study:"work",travel:"overall"}[$.key]||$.key,y=(u.interpret?.dimensions||[]).find(M=>M.key===$.key||M.key===d);if(y){const M=u.frame&&u.frame.godStats&&u.frame.godStats.groups||{},O=$.key==="wealth"?` 财星权重 ${Number(M.财||0)}(只作结构参考,不含金额)。`:"";return{ok:!0,year:null,topic:$,answer:`按${$.label}这条线看:${y.text}${O}${y.advice?` 建议:${y.advice}`:""}`,evidence:(y.evidence||[]).slice(0,4),confidence:y.confidence||"中"}}const x=u.frame&&u.frame.godStats&&u.frame.godStats.groups||{};if(Object.keys(x).length){const M=["比劫","食伤","财","官杀","印"].map(O=>`${O} ${Number(x[O]||0)}`);return{ok:!0,year:null,topic:$,answer:`「${$.label}」这条线,这一盘只带了盘面结构:${M.join("、")}。具体吉凶与建议需要解析层(排盘时加 withInterpret),追问这里不自行推演。`,evidence:M.slice(0,3),confidence:"弱"}}}return{ok:!1,year:null,topic:$,answer:`这个问题里没有识别到具体的年份或方面。可以这样问:「2027 年事业怎么样」「财运如何」「感情在 2028 年」;已排流年是 ${h[0]}–${h[h.length-1]}。`,evidence:[`可问年份:${h.join("、")}`],confidence:"弱"}}function z(u,N){const j=H(N,u),$=Y(N),g=Array.isArray(u.liunian)?u.liunian:[];if(j&&!g.some(o=>Number(o.year)===j))return{ok:!1,year:j,topic:$,answer:`这一盘的流年表覆盖 ${g[0]?.year}–${g[g.length-1]?.year},没有 ${j} 年;可以换一个年份,或用 asOf 指定起点重新排盘。`,evidence:[`流年表:${g.map(o=>o.year).join("、")}`],confidence:"弱"};if(j){const o=g.find(d=>Number(d.year)===j),h=o.daxian||{};return{ok:!0,year:j,topic:$,answer:`${j} 年(${o.ganzhi},${o.age} 岁)流年命宫落在「${o.lifePalace?o.lifePalace.palace:"—"}」,四化为 ${(o.mutagen||[]).join("、")||"不明显"};所行大限${h.palace?`在${h.palace}(${h.start}–${h.end} 岁)`:"未取到"}。${$?`与「${$.label}」对应的宫位信号见下条依据。`:""}`,evidence:[`流年命宫 ${o.lifePalace?o.lifePalace.palace:"—"}(${o.lifePalace?o.lifePalace.branch:"—"})`,`四化 ${(o.mutagen||[]).join("、")||"不明显"}`,h.palace?`大限 ${h.palace}·${h.start}–${h.end}岁`:""].filter(Boolean),confidence:(o.mutagen||[]).length>=3?"强":"中"}}if($){const o=F[$.key]||"命宫",h=(u.palaces||[]).find(d=>d.palace===o);if(h){const d=(h.stars||[]).filter(x=>x.type==="主星").map(x=>x.name),y=d.map(x=>P[x]?.trait).filter(Boolean).slice(0,2).join(";");return{ok:!0,year:null,topic:$,answer:`「${$.label}」看${o}:主星${d.length?d.join("、"):"无正曜(借对宫)"}${y?`——${y}`:""}。宫支${h.branch},${h.stems,""}生年四化与煞星的影响需结合报告里的对应分节一起看。`,evidence:[`${o} ${h.branch}·${d.join("、")||"无正曜"}`,...(h.shensha||[]).slice(0,3)],confidence:d.length?"强":"弱"}}}return{ok:!1,year:null,topic:$,answer:"没有识别到具体年份或方面。可以问「2028 年事业」「感情怎么样」「财运在 2030 年」;也可以直接问某个宫位,如「夫妻宫」。",evidence:[],confidence:"弱"}}function I(u,N){return`这段时间可以重点对照报告里「${{career:"事业",wealth:"财富",love:"感情",health:"健康",study:"学业",travel:"出行"}[N]||"整体"}」一节看。`}function k(u,N){const j=Y(N),$=Array.isArray(u.interpret?.sections)?u.interpret.sections:[],g=j?$.find(d=>d.label.includes(j.label)||d.text.includes(j.label)):null;if(g)return{ok:!0,year:null,topic:j,answer:g.text,evidence:[`引用分节:${g.label}`],confidence:"中"};const o=$[0];if(o)return{ok:!1,year:null,topic:j,answer:`这一盘的追问需要落到具体方面(事业 / 财富 / 感情 / 健康 / 学业 / 出行)。先看「${o.label}」这一节,或把问题说得更具体一点。`,evidence:[],confidence:"弱"};const h=String(u&&u.summary||"").trim();if(h){const d=h.split(`
73
- `).map(x=>x.trim()).filter(Boolean),y=j?d.filter(x=>j.words.some(M=>x.includes(M))):[];return{ok:!0,year:null,topic:j,answer:y.length?`${j.label}相关的盘面字段:${y.slice(0,3).join(";")}。这一盘没带解析层,只列盘面事实,不在这里补吉凶结论。`:`这一盘没有解析层,只能按盘面字段回答;可问的方向:${B.map(x=>x.label).join(" / ")}。下面任取摘要是盘面原文,未作推演。`,evidence:(y.length?y:d).slice(0,4),confidence:"弱"}}return{ok:!1,year:null,topic:j,answer:"这一盘暂时没有可追问的分节,也没有摘要字段;先重新排一次盘,再问具体方面。",evidence:[],confidence:"弱"}}function m(u,N){const j=String(N||"").trim(),$=u&&u.system==="bazi"?q(u,j):u&&u.system==="ziwei"?z(u,j):k(u,j);return{question:j,...$}}const f={bazi:"八字(四柱)",ziwei:"紫微斗数",liuyao:"六爻",meihua:"梅花易数",daliuren:"大六壬",qimen:"奇门遁甲",tarot:"塔罗",hepan:"合盘",chenggu:"称骨",almanac:"黄历",zeri:"择日",star:"星座",numerology:"生命数字",mbti:"十六型人格",trend:"人生 K 线",fengshui:"风水",name:"起名",convert:"公农历互转"},_=Object.freeze({bazi:["基本信息","四柱(日主/十神/藏干)","旺衰·格局·用神","合冲·神煞","起运·大运·流年","古籍依据"],ziwei:["基本信息","命宫/身宫与五行局","十二宫(主星/辅煞/四化)","格局与三方四正","大限/流年","古籍依据"],liuyao:["所问与用神","本卦/变卦(世应/动爻/六亲)","月建日辰(旺衰/空破)","应期线索","卦辞与依据"],meihua:["所问与体用","本卦/互卦/变卦","五行生克","应期与依据"],daliuren:["天地盘(月将/贵人)","四课","三传","课体与神将","依据"],qimen:["四柱与局数","九宫(星门神/天盘干)","用神落宫","门宫·干宫·十干克应","旺衰·击刑入墓","依据"],tarot:["问题与牌阵","逐牌(正逆/牌面/元素对应)","牌间关系","综合倾向","边界"],fengshui:["坐向与元运","运盘/山盘/向盘","旺山旺向","取象与边界"]}),A=Object.freeze(["基本信息","盘面事实","结构与关系","倾向","边界"]);function s(u){return _[u]||A}function c(u,N={}){const j=f[u&&u.system]||u&&u.system||"未知体系",g=String(N&&N.question||"").trim()||"请先用一句白话讲清这张盘的主线,再指出最值得注意的一两处,并说明每处的具体依据。",o=Number.isFinite(N&&N.maxChars)&&N.maxChars>=400?N.maxChars:3e3,h=String(u&&u.summary||"").trim(),d=h.length>o,y=d?`${h.slice(0,o)}…(摘要已截断)`:h,x=N&&typeof N.interpret=="object"&&N.interpret||u&&typeof u.interpret=="object"&&u.interpret||null,M=String(x&&x.answer||"").trim(),O=String(x&&x.plain||"").trim(),G=[];M&&G.push(`直答:${M}`),O&&G.push(`说人话:${O}`);const C=["【命理追问】下面这张盘是命理插件刚排好的,请就着它回答我的问题;不用重新排盘,盘面字段已经够用。",`体系:${j}`,`所问:${g}`,"",...G.length?["——开场结论(插件已按同一套规则算好,开场先沿用这句;措辞可改,口径别换)——",...G,""]:[],"——盘面层次(从上到下读,别跳层)——",`${j}:${s(u&&u.system).join(" → ")}`,"先复述事实,再讲结构与时间;上一层没交代清楚,不要跳到下一层。","","——盘面摘要——",y||"(这张盘没有摘要字段,请先让我重新排一次。)",...String(u&&u.jing||"").trim()?["","——《周易》经文原文(本插件按三份底本互校照录,〔一作…〕是异文,不是改写)——",String(u.jing).trim()]:[],...u&&u.zuoyao&&u.zuoyao.verses?["",`——紫微杂曜安星诀(本盘开了全表,${u.zuoyao.placed.length} 颗已按下列诀安入;诀文出多处近代通行辑本并核,属通行说,不是《紫微斗数全书》原文)——`,String(u.zuoyao.verses).trim(),`未另立:${(u.zuoyao.skipped||[]).join(";")}`]:[],"","——回答要求——","读者不懂命理。按下面的骨架答;任何一句他看不懂,就算没写完:",G.length?"1) 开头一句结论:先沿用上面的「开场结论」,再用一句不用术语的话说清这张盘的主线——只读这一句也该有收获;":"1) 开头一句结论:不用术语,一句话说清这张盘的主线,只读这一句也该有收获;","2) 第二段只复述盘面骨架:按上面的层次用 2–4 行写事实(如四柱、格局、用神、大运),不掺倾向,让读者知道后面的判断从哪来;","3) 判断最多两条,按重要性排序,每条分四行写:"," 盘面|只引盘面已有的字(具体的柱、宫或爻、字段名),不掺解释;"," 白话|把上一行的术语当场翻成日常话——调候 / 化气 / 通关 / 空亡 / 争合 这类词必须落地,一个词只翻一次,不连续堆三个以上;"," 倾向|说「更可能……」,讲清它在现实里大概意味着什么,用概率语气;"," 边界|这条在什么情况下不成立;盘面没给的,直接写「这盘里看不出来」;","4) 收尾一句「如果只记一件事」:给一条能核对、能动手的观察点,并说明它出自上面哪条盘面依据;","5) 别把传统说法当成已证实的事实:不下绝对断言,也不用「肯定」「绝对」这类词,更不写「格局很好」「运程不顺」这种没有信息的空话。"].join(`
74
- `);return{text:C,question:g,system:u&&u.system||"",label:j,chars:C.length,truncated:d}}return{followup:m,READING_ORDERS:_,READING_ORDER_FALLBACK:A,readingOrderOf:s,askPrompt:c}})(),R.revise=(function(){const P=[{key:"ziwei",label:"紫微",re:/紫微|斗数/},{key:"bazi",label:"八字",re:/八字|四柱/},{key:"liuyao",label:"六爻",re:/六爻|摇卦/},{key:"qimen",label:"奇门",re:/奇门/},{key:"daliuren",label:"大六壬",re:/大六壬|六壬/},{key:"tarot",label:"塔罗",re:/塔罗|抽牌/},{key:"meihua",label:"梅花",re:/梅花/},{key:"hepan",label:"合盘",re:/合盘|合婚/},{key:"almanac",label:"黄历",re:/黄历|老黄历/},{key:"zeri",label:"择日",re:/择日|挑日子/},{key:"fengshui",label:"风水",re:/风水/},{key:"name",label:"起名",re:/起名|取名/},{key:"chenggu",label:"称骨",re:/称骨/},{key:"xiaoliuren",label:"小六壬",re:/小六壬/},{key:"star",label:"星座",re:/星座/},{key:"numerology",label:"生命数字",re:/生命数字|生命灵数/},{key:"mbti",label:"MBTI",re:/mbti|人格测试|十六型/i},{key:"trend",label:"人生 K 线",re:/k\s*线|人生曲线/i},{key:"convert",label:"公农历互转",re:/农历转公历|公历转农历|公农历/}],B=[{key:"love",label:"感情",re:/感情|婚姻|恋爱|对象|夫妻/},{key:"wealth",label:"财运",re:/财运|财富|赚钱|收入|破财/},{key:"career",label:"事业",re:/事业|工作|升职|跳槽/},{key:"health",label:"健康",re:/健康|身体|疾病|病/},{key:"study",label:"学业",re:/学业|考试|考研|升学|读书/},{key:"travel",label:"出行",re:/出行|搬家|迁移|旅行|外地/}],F=/换成|改成|改为|换到|改看|再看|再看一下|换一套|排一?张|用|按|看/,H=k=>String(k||"").replace(/(出生|出生地|所在地|人)$/,"").replace(/[的了].*$/,"").trim();function Y(k){const m=String(k??"").trim(),f={},_=[],A=[];if(!m)return{text:"",patch:f,labels:_,ignored:A};if(F.test(m)){for(const u of P)if(u.re.test(m)){f.system=u.key,_.push({key:"system",label:"体系",value:u.key,display:u.label});break}}/女命|女性|换成女|改成女|女盘/.test(m)?(f.gender="female",_.push({key:"gender",label:"性别",value:"female",display:"女"})):/男命|男性|换成男|改成男|男盘/.test(m)&&(f.gender="male",_.push({key:"gender",label:"性别",value:"male",display:"男"})),/晚子时/.test(m)&&(/不换日|不换天|算当日|归当日|按当日|当天/.test(m)?(f.lateZi=!1,_.push({key:"lateZi",label:"晚子时",value:!1,display:"23:00 后仍算当日"})):/换日|算次日|归次日|按次日|第二天|次日/.test(m)&&(f.lateZi=!0,_.push({key:"lateZi",label:"晚子时",value:!0,display:"23:00 后算次日"}))),/真太阳时/.test(m)&&(/不用|不要|关闭|关掉|取消|不算/.test(m)?(f.trueSolar=!1,_.push({key:"trueSolar",label:"真太阳时",value:!1,display:"用东八区平太阳时"})):(f.trueSolar=!0,_.push({key:"trueSolar",label:"真太阳时",value:!0,display:"按出生地经度校正"}))),/夏令时/.test(m)&&(/不用|不要|关闭|关掉|取消|不校正/.test(m)?(f.dst=!1,_.push({key:"dst",label:"夏令时",value:!1,display:"不自动校正 1986–1991 夏令时"})):(f.dst=!0,_.push({key:"dst",label:"夏令时",value:!0,display:"自动校正 1986–1991 夏令时"})));const s=m.match(/出生在\s*([\u4e00-\u9fa5]{2,12})/)||m.match(/出生地(?:改成|改为|换成|换到|是|为)?\s*([\u4e00-\u9fa5]{2,12})/)||m.match(/改到\s*([\u4e00-\u9fa5]{2,12})\s*出生/);if(s){const u=H(s[1]);u.length>=2&&(f.address=u,_.push({key:"address",label:"出生地",value:u,display:u}))}const c=m.match(/(?:看|查|问|到|到了|临近)\s*((?:19|20)\d{2})\s*年/)||m.match(/((?:19|20)\d{2})\s*年(?:的)?(?:运势|怎么样|如何|会怎样|流年)/);if(c){const u=Number(c[1]);f.asOf=`${u}-01-01T00:00`,_.push({key:"asOf",label:"流年基准",value:f.asOf,display:`${u} 年`})}else/(出生|生年)/.test(m)&&/(19|20)\d{2}\s*年/.test(m)&&A.push("出生年份没改:一句话改不出日与时辰,请直接传 datetime(如 1993-04-08T06:20)");for(const u of B)if(u.re.test(m)){f.direction=u.key,_.push({key:"direction",label:"询问方向",value:u.key,display:u.label});break}return/解读|详解|详细说|说人话/.test(m)&&!/不要解读|不用解读|别解读/.test(m)&&(f.withInterpret=!0,_.push({key:"withInterpret",label:"解读",value:!0,display:"附解析与详解"})),{text:m,patch:f,labels:_,ignored:A}}const q=P,z=B;function I(k,m){if(m==null)return null;if(k==="system"){const f=P.find(_=>_.key===m);return f?f.label:String(m)}if(k==="gender")return m==="female"?"女":m==="male"?"男":String(m);if(k==="direction"){const f=B.find(_=>_.key===m);return f?f.label:String(m)}if(typeof m=="boolean")return m?"开":"关";if(k==="asOf"){const f=String(m).match(/^(\d{4})/);return f?`${f[1]} 年`:String(m)}return String(m)}return{parseRevision:Y,REVISE_SYSTEMS:q,REVISE_DIRECTIONS:z,displayValue:I}})(),R.handle=(function(){const{fail:P}=R.fail||{},B="mc1.",F=new Set(["handle","trace","shadow","shadowVersion","diff","withInterpret","detail","cross","verifyPast","rectify","events","ask","followup","question","geocode","caliber","geo","longitudeFromGeo","revise"]),H=h=>h!==null&&typeof h=="object"&&!Array.isArray(h);function Y(h){if(Array.isArray(h))return`[${h.map(y=>Y(y===void 0?null:y)).join(",")}]`;if(H(h))return`{${Object.keys(h).filter(x=>h[x]!==void 0).sort().map(x=>`${JSON.stringify(x)}:${Y(h[x])}`).join(",")}}`;const d=JSON.stringify(h===void 0?null:h);return d===void 0?"null":d}function q(h){let d=2166136261;for(let y=0;y<h.length;y++)d^=h.charCodeAt(y),d=Math.imul(d,16777619)>>>0;return d.toString(16).padStart(8,"0")}const z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function I(h){const d=[];for(const y of String(h)){let x=y.codePointAt(0);x<128?d.push(x):x<2048?d.push(192|x>>6,128|x&63):x<65536?d.push(224|x>>12,128|x>>6&63,128|x&63):d.push(240|x>>18,128|x>>12&63,128|x>>6&63,128|x&63)}return d}function k(h){let d="";for(let y=0;y<h.length;){const x=h[y];let M,O;x<128?(M=x,O=1):x<224?(M=x&31,O=2):x<240?(M=x&15,O=3):(M=x&7,O=4);for(let G=1;G<O;G++)M=M<<6|h[y+G]&63;y+=O,d+=String.fromCodePoint(M)}return d}function m(h){const d=I(h);let y="";for(let x=0;x<d.length;x+=3){const M=d[x],O=d[x+1],G=d[x+2];if(y+=z[M>>2],y+=z[(M&3)<<4|(O===void 0?0:O)>>4],O===void 0||(y+=z[(O&15)<<2|(G===void 0?0:G)>>6],G===void 0))break;y+=z[G&63]}return y}function f(h){const d=[];let y=0,x=0;for(const M of h){const O=z.indexOf(M);if(O<0)throw new Error(`不是 base64url 字符:${M}`);y=y<<6|O,x+=6,x>=8&&(x-=8,d.push(y>>x&255))}return k(d)}function _(h={}){const d={};for(const[y,x]of Object.entries(h||{}))F.has(y)||x===void 0||(d[y]=x);return d}function A(h={}){const d=_(h);if(!Object.keys(d).length)return"";const y=m(Y(d));return`${B}${y}.${q(y)}`}function s(h){if(typeof h!="string"||!h.trim())throw P("E_HANDLE","handle 必须是非空字符串;没拿到句柄时照常传 system + datetime 等原始参数即可");const d=h.trim();if(!d.startsWith(B))throw P("E_HANDLE",`handle 前缀不对(应以 ${B} 开头):句柄来自旧版本或复制不全,重新排一次盘取新的 handle`);const y=d.slice(B.length),x=y.lastIndexOf(".");if(x<=0)throw P("E_HANDLE","handle 缺少校验位:复制时可能被截断,重新取一次");const M=y.slice(0,x),O=y.slice(x+1);if(q(M)!==O)throw P("E_HANDLE","handle 校验不通过:内容被改动或截断,重新排一次盘取新的 handle");let G;try{G=JSON.parse(f(M))}catch{throw P("E_HANDLE","handle 内容无法解析(不是本插件生成的句柄),重新排一次盘取新的 handle")}if(!H(G))throw P("E_HANDLE","handle 内容不是参数对象,重新排一次盘取新的 handle");return G}const c=new Set(["__proto__","constructor","prototype"]),u={hour:["chenggu","xiaoliuren","name"],minute:["name"],date:["xiaoliuren"],mode:["convert","meihua","xiaoliuren"],action:["fengshui","name"]};function N(h,d){if(!H(h))return h;const y=h.system;if(typeof y!="string"||!y)return h;for(const[x,M]of Object.entries(u))d.has(x)||h[x]===void 0||M.includes(y)||delete h[x];return h}function j(...h){const d=new Set;for(const y of h)if(H(y))for(const[x,M]of Object.entries(y))M!==void 0&&x!=="handle"&&d.add(x);return d}function $(h={}){if(!H(h))return h;const{handle:d,...y}=h;if(d==null||d==="")return{...y};const M={...s(d)};for(const[O,G]of Object.entries(y))G===void 0||c.has(O)||(M[O]=G);return N(M,j(y)),M}return{handlePayload:_,encodeHandle:A,decodeHandle:s,pruneForeignKeys:N,ownedKeys:j,resolveHandle:$,HANDLE_PREFIX:B,handleChecksum:q}})(),R.bridge=(function(){const{encodeHandle:P,decodeHandle:B,HANDLE_PREFIX:F}=R.handle||{},{askPrompt:H}=R.followup||{},Y=200,q=60,z={bazi:"八字",ziwei:"紫微",liuyao:"六爻",meihua:"梅花",daliuren:"大六壬",qimen:"奇门",hepan:"合盘",tarot:"塔罗",almanac:"黄历",zeri:"择日",chenggu:"称骨",xiaoliuren:"小六壬",star:"星座",numerology:"生命数字",mbti:"人格",trend:"人生K线",fengshui:"风水",name:"起名",convert:"农历",constitution:"体质",wuyunliuqi:"运气",taiyi:"太乙"},I=$=>z[$]||$||"未知体系";function k($){const g=String($||""),o=g.indexOf("#");return o<0?g:g.slice(0,o)}function m($){try{return encodeURIComponent($)}catch{return""}}function f($){try{return decodeURIComponent($)}catch{return String($||"")}}function _($={},g={}){const o=g||{},d=String(o.handle||$&&$.handle||"").trim()||P($||{});if(!d||!d.startsWith(F))return"";const y=String(o.question||"").trim().slice(0,Y),x=[`mp=${d}`];return y&&x.push(`q=${m(y)}`),`${k(o.base)}#${x.join("&")}`}function A($){const g=String($||"").trim();if(!g)return{ok:!1,code:"E_LINK",message:"没有链接内容:请粘贴带 #mp= 的完整链接"};let o="";const h=g.indexOf("#");if(h>=0&&g.slice(h+1).trim())o=g.slice(h+1).trim();else{const M=g.indexOf("?");M>=0&&g.slice(M+1).trim()?o=g.slice(M+1).trim():/^mp=/.test(g)&&(o=g)}if(!o)return{ok:!1,code:"E_LINK",message:"链接里没有 #mp= 片段:这不是本插件生成的深链"};const d={};for(const M of o.split("&")){if(!M)continue;const O=M.indexOf("=");if(O<=0)continue;const G=M.slice(0,O),se=M.slice(O+1);G==="mp"?d.mp=se:G==="q"&&(d.q=se)}if(!d.mp)return{ok:!1,code:"E_LINK",message:"链接里没有 mp 参数(只有问题没有盘):无法还原盘面"};let y;try{y=B(d.mp)}catch(M){return{ok:!1,code:M&&M.code||"E_HANDLE",message:M&&M.message||"句柄无法解析"}}const x=d.q?f(d.q).slice(0,Y):"";return{ok:!0,handle:d.mp,args:y,question:x,system:y.system||"",label:I(y.system)}}const s=$=>{const g=/^(\d{4}-\d{1,2}-\d{1,2})[T ](\d{1,2}:\d{2})/.exec(String($||"").trim());if(!g)return{date:"",time:""};const[o,h,d]=g[1].split("-");return{date:`${o}-${String(h).padStart(2,"0")}-${String(d).padStart(2,"0")}`,time:g[2].padStart(5,"0")}},c=["gender","address","trueSolar","lateZi","lines"];function u($){const g=$&&$.ok?$:null,o=g&&g.args||{},h=s(o.datetime),d={tab:o.system||"",date:h.date,time:h.time,question:g&&g.question||"",restored:[],rest:{}};d.tab&&d.restored.push("system"),h.date&&d.restored.push("datetime");for(const y of c)o[y]===void 0||o[y]===null||(d[y]=o[y],d.restored.push(y));d.question&&d.restored.push("question");for(const[y,x]of Object.entries(o))y==="system"||y==="datetime"||c.includes(y)||(d.rest[y]=x);return d}function N($){const g=Object.keys($&&$.rest||{});return g.length?`链接里还有 ${g.length} 项没填回表单(${g.join("、")}):这些只在引擎调用里生效,页面上按默认值显示。`:""}function j($,g={}){const o=g||{},h=$||{},d=h.system||"",y=I(d),x=String(o.question||"").trim(),M=String(h.handle||"").trim();let O="";try{const $e=H(h,{question:x,interpret:o.interpret});O=$e&&$e.text||String(h.summary||"")}catch{O=String(h.summary||"")}const G=x?x.length>q?`${x.slice(0,q)}…`:x:"(未填问题:按摘要讲主线)",se=M?`【命理追问】${y}|${M}|问:${G}`:`【命理追问】${y}|问:${G}`,C={};M&&(C.handle=M),d&&(C.system=d),x&&(C.question=x);const X=JSON.stringify({tool:"metaphysics",v:1,args:C},null,2),me=M?_({handle:M},{question:x,base:o.base}):"";return{system:d,label:y,handle:M,question:x,full:O,brief:se,structured:X,link:me}}return{LINK_MAX_QUESTION:Y,askLink:_,parseAskLink:A,formOf:u,restNote:N,askPackages:j}})(),R["plain-summary"]=(function(){const{ASK_KINDS:P}=R["event-prompt"]||{},{PALACE_FIELD:B,GATE_MEANING:F}=R["qimen-prompt"]||{},H=P||{},Y=B||{},q=F||{},z={wealth:"business",career:"career",love:"love",health:"other",study:"career",travel:"action",general:"other"},I=a=>z[a]||(H[a]?a:"other"),k={木:{color:"青、绿",where:"东边、有树有水的地方",daily:"早上多出门走走"},火:{color:"红、橙、紫",where:"南边、向阳的房间",daily:"白天多晒太阳,别总待在阴冷的屋里"},土:{color:"黄、棕、米色",where:"中原地带、干爽高燥处",daily:"把作息和吃饭时间固定下来"},金:{color:"白、银、浅灰",where:"西边、通风利落的地方",daily:"把该断的事断干净,别拖"},水:{color:"黑、深蓝",where:"北边、临水处",daily:"留出独处和放空的时间"}},m={正印:"靠吸收和消化来获得安全感,习惯先想明白再动",偏印:"想得比说得多,一件事会在心里推演出很多种可能",正官:"对规矩和责任敏感,别人一句交代会变成自己的压力",七杀:"对压力和竞争敏感,遇强则强,也容易被强势的人吸引",正财:"对现实条件敏感,不太会被空话打动",偏财:"对机会敏感,愿意为看得见的回报承担风险",食神:"表达温和,喜欢把日子过得有滋味",伤官:"有自己的标准,看不上粗糙的东西,容易先挑毛病",比肩:"自我边界清楚,不太愿意被安排",劫财:"同辈之间容易较劲,也容易替朋友出头"},f={长生:"刚起步,有生机",沐浴:"不安定,容易被外界牵动",冠带:"在成形,开始要面子",临官:"正当力,能扛事",帝旺:"很足,但也容易过满",衰:"开始收力,做事偏保守",病:"使不上劲,需要借外力",死:"静态,不爱主动",墓:"收着、藏着,不爱外露",绝:"在这里使不上劲,容易觉得被压着",胎:"还在孕育,慢热",养:"在积攒,等时机"},_={紫微:"要主导、在意体面",天机:"脑子转得快,爱盘算",太阳:"愿意给出去,也容易被消耗",武曲:"务实,认结果",天同:"图安稳,怕冲突",廉贞:"要强,情绪起伏大",天府:"稳,能存住东西",太阴:"细腻,心思藏在里面",贪狼:"欲望强、多才多艺",巨门:"爱辨析,也容易生口舌",天相:"会配合,擅长讲和",天梁:"老成,愿意护着别人",七杀:"独断,敢冲",破军:"破旧立新,不安于现状"},A={庙:"得力",旺:"得力",得地:"还算得力",平:"一般",陷:"不太稳"},s=a=>[...new Set(a.filter(Boolean))],c={寅:"初春",卯:"仲春",辰:"暮春",巳:"初夏",午:"盛夏",未:"长夏",申:"初秋",酉:"仲秋",戌:"深秋",亥:"初冬",子:"仲冬",丑:"隆冬"};function u(a,b){const D={po:[],chong:[],he:[]};for(const ee of a&&a.branches||[])!b||!String(ee).includes(b)||(/破/.test(ee)?D.po.push(ee):/冲/.test(ee)?D.chong.push(ee):/合/.test(ee)&&D.he.push(ee));return D}function N(a){const b=a.pillars||{},D=b.day||{},ee=b.month||{},S=a.dayMaster||{},T=a.climate||{},L=a.input&&a.input.gender||"female",K=Object.entries(a.frame&&a.frame.godStats&&a.frame.godStats.groups||{}).filter(([,de])=>de>0).sort((de,Te)=>Te[1]-de[1]),Q=a.frame&&a.frame.yongshen&&a.frame.yongshen.favorTenGods||[],oe=a.frame&&a.frame.yongshen&&a.frame.yongshen.favor||[],ie=a.frame&&a.frame.yongshen&&a.frame.yongshen.avoid||[],ue=c[ee.branch]||`${ee.branch}月`,U=T.label==="寒湿"?"天寒水旺,木像冬天的藤,不是不强,是冷得伸展不开":T.label==="燥热"?"火土偏燥,像久旱的地,需要水和湿气来松一松":"寒暖相对均衡,没有极端的偏枯",ce=T.need&&T.need.element||oe[0]||"",le=a.frame&&a.frame.caiKu||null,be=le?le.present?le.opened&&le.verdict==="开库主发"?`财有库(${le.store}),而且库门被${le.opener}冲开了:钱是能进来的,关键在于你肯不肯把它存住。`:le.opened&&le.verdict==="开库反主破财"?`财有库(${le.store})也被冲开了,但这一行在你这盘上是忌:动得越多漏得越快,稳比冲重要。`:le.opened?`财有库(${le.store}),库门也开了,但财本身不算厚:有得有失,别指望一次翻身。`:`财有库(${le.store}),门还关着:不是没有,是要等对的时间或对的选择把它引出来。`:"财这一路没有立库,赚多少看明面上的财星与行运,不靠「开库」这一说。":"",Ne=`${S.stem||""}${S.element||""}日主,生在${ue}${ee.branch||""}月:${U}。${ce?`最需要的是${ce}${T.need&&T.need.why?`——${T.need.why}`:""}。`:""}整体${a.strength?a.strength.level:"中和"},不是极旺也不是极弱,所以${a.strength&&a.strength.level==="身弱"?"很多事要靠外部条件配合,硬扛不如借力":"撑得住,关键是别把力气用在错的地方"}。`+be,te=K.slice(0,2).map(([de])=>de),ye=[];for(const de of Object.values(b))de&&(de.stemTenGod&&ye.push(de.stemTenGod),de.hidden&&de.hidden[0]&&de.hidden[0].tenGod&&ye.push(de.hidden[0].tenGod));const Ze=`${te.map(de=>{const Te={印:["正印","偏印"],官杀:["正官","七杀"],食伤:["食神","伤官"],财:["正财","偏财"],比劫:["比肩","劫财"]}[de]||[],_e=Te.find(Re=>ye.includes(Re))||Te[0];return _e&&m[_e]?`${de}偏重:${m[_e]}。`:""}).filter(Boolean).join("")}${Q.length,""}`+(te.includes("印")?"想得多是你的默认状态,好处是稳,代价是慢和累。":""),Je=L==="female"?["正官","七杀"]:["正财","偏财"],Ye=L==="female"?"官杀(正官与七杀)":"财星(正财与偏财)",De={year:"年干",month:"月干",day:"日干",hour:"时干"},Ie=Object.entries(b).filter(([,de])=>de&&Je.includes(de.stemTenGod)).map(([de,Te])=>`${De[de]}${Te.stemTenGod}`),Pe=D.hidden&&D.hidden[0]&&D.hidden[0].tenGod||"",Ae=u(a.relations,D.branch),Ee=[];Ee.push(`${L==="female"?"女命":"男命"}看配偶星取${Ye}${Ie.length?`,${Ie.join("、")}`:",盘中未透干"}${Ie.length?"——摆在明处,说明这件事在你生活里是绕不开的主题":"——不显在明处,往往要靠后天遇到的人把它带出来"}。`),Pe&&Ee.push(`日支(配偶宫)坐${D.branch}${Pe}${D.dishi?`,日主在这里是「${D.dishi}」:${f[D.dishi]||""}`:""}。`),Ae.po.length&&Ee.push(`日支与另一支相破(${Ae.po.join("、")}):破不是吵架,是那种说不清、解释不明白的暗耗,容易冷处理。`),Ae.chong.length&&Ee.push(`日支逢冲(${Ae.chong.join("、")}):关系里变动感强,聚散、异地、节奏不一致都可能出现。`),Ae.he.length&&Ee.push(`日支有合(${Ae.he.join("、")}):容易被关系拴住,进去了就不太想出来。`),a.hourUnknown&&Ee.push("时柱暂缺,所以「子女」这一路的信息读不出,感情结论也就少了三分之一。");const Ce=(a.frame&&a.frame.geju||[]).map(de=>de.name),Oe=[];Ae.po.length&&Oe.push("破在日支:最伤人的往往不是大事,是没说开的小事。"),Ce.includes("伤官见官")&&Oe.push("盘里有「伤官见官」的组合:既想要稳定,又忍不了对方的毛病,这是同一件事的两面。"),te.includes("印")&&!te.includes("财")&&Oe.push("印重而财轻:想得多、落得少;越焦虑越容易继续想。"),Oe.length||Oe.push("这一盘没有特别尖锐的冲克,卡点更多在「节奏」上——什么时候该动,什么时候该停。");const ve=[];if(ce&&k[ce]){const de=k[ce];ve.push(`多接触${ce}:${de.color}这类颜色、${de.where},日常可以${de.daily}。`)}ie.length&&ve.push(`少把自己放在${ie.slice(0,2).join("、")}过重的环境里——不是不能碰,是别长期待在那种氛围中。`),te.includes("印")&&ve.push("给「想」设个时限:一件事想超过十分钟还没结论,就先做一个最小动作,用行动换信息。"),Ce.includes("伤官见官")&&ve.push("把标准用在事情上,不要用在人身上;对人提要求之前,先说清你需要什么。");const we=a.frame&&a.frame.balance||null;if(we){const de=[];we.wuxing.ok||de.push(`五行偏在${we.wuxing.highest}、缺在${we.wuxing.lowest}`),we.yinyang.ok||de.push(we.yinyang.pure?`${we.yinyang.pure}之局`:`阴阳一边倒(阳 ${we.yinyang.yang}/阴 ${we.yinyang.yin})`),we.climate.ok||de.push(`寒暖燥湿没调匀(${we.climate.kind})`),ve.push(de.length?`结构上${de.join("、")}:不必去「补命」,把这几处当作长期要照看的方向就行。`:"五行、阴阳、寒暖燥湿三方面都还匀:这种盘最忌讳的是为了「更好」而硬改节奏,稳住就是优势。")}return{system:"bazi",title:"先看这一张:这张盘大致在说什么",chips:s([`${S.stem||""}${S.element||""}日主`,`${ee.branch||""}月`,T.label||"",a.strength?a.strength.level:"",a.hourUnknown?"时柱暂缺":""]),lead:Ne,sections:[{h:"你的底色",t:Ze||"结构比较均衡,没有一边倒的偏重。"},{h:"感情这件事",t:Ee.join("")},{h:"最容易卡住的地方",t:Oe.join("")}],advice:ve,caveat:a.hourUnknown?"时柱暂缺:以上只据年、月、日六个字,等于全盘信息的七成左右。子女缘分、晚年走势、以及「内心最深处那一层」都读不全,结论只作参考。":"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}function j(a){const b=a.palaces||[],D=b[0]||{},ee=a.body||{},S=(D.stars||[]).filter(te=>te.type==="主星"),T=b.find(te=>te.isBody)||{},L=b.find(te=>te.palace==="夫妻")||{},K=S.map(te=>te.name).join("、")||"空宫(借对宫)",Q=S.map(te=>A[te.brightness]||"").filter(Boolean)[0]||"",oe=te=>te.filter(ye=>ye.type==="主星").map(ye=>`${ye.name}${_[ye.name]?`(${_[ye.name]})`:""}`).join(";"),ie=a.patternSummary||{},ue=s(ie.broken||[]),U=s(ie.bad||[]),ce=s([...ie.good||[],...ie.neutral||[]]).filter(te=>!ue.includes(te)),le=L.stars||[],be=le.filter(te=>te.type==="主星"),Ne=le.filter(te=>te.type==="煞星");return{system:"ziwei",title:"先看这一张:这张盘大致在说什么",chips:s([`命宫在${D.branch||""}`,K,a.bureau?a.bureau.name:"",ee.lands?`身宫落${ee.lands}`:""]),lead:`命宫在${D.branch||""},坐${K}${Q?`(${Q})`:""};身宫落在${ee.lands||ee.palace||"—"}。${S.length?`底色是${S.map(te=>_[te.name]||te.name).join("、")}。`:"命宫无主星,性格更多由对宫与三方决定,可塑性反而大。"}${ce.length?`结构上成的是${ce.slice(0,3).join("、")}——格局只说明形状,不是吉凶判词。`:"没有完整成套的格局,这一盘更多看单颗星的性质,少看组合。"}`,sections:[{h:"你的底色",t:`${oe(D.stars||[])||"命宫无主星,靠三方四正补"}。身宫落${ee.lands||"—"},说明你这辈子真正花力气的地方在${ee.lands||"那一块"}。`},{h:"感情这件事",t:`夫妻宫在${L.branch||"—"},坐${be.map(te=>`${te.name}${te.brightness?`(${A[te.brightness]||te.brightness})`:""}`).join("、")||"空宫(借对宫)"}。${Ne.length?`同宫还有${Ne.map(te=>te.name).join("、")}——关系里容易起摩擦,来得快也去得快。`:"没有明显的煞星同宫,关系相对平顺。"}`},{h:"最容易卡住的地方",t:`${ue.length?`被冲破的格局有${ue.join("、")}——结构还在,但成色打折;冲不等于毁,说的是它不如完好时那么顶用。`:"主要格局没有明显被冲破。"}${U.length?`另有${U.join("、")}这类忌格,只描述结构,不作吉凶断。`:""}`}],advice:[`命宫主星${S.length?`是${S.map(te=>te.name).join("、")},顺它的长处在做事,比硬改性格省力`:"不显,先靠环境和习惯替自己定节奏"}。`,`身宫落${ee.lands||"—"}:这块是你真正在意的地方,也是容易耗人的地方,留出余量。`],caveat:"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}const $={旺:"当令,气最足",相:"有生机,正在起",休:"气在泄,歇着",囚:"被压着,使不上劲",死:"最弱,得靠外援"},g={官鬼:"职位、压力、管你的人和事",妻财:"钱、资源、实际回报",父母:"文书、答复、流程与长辈",子孙:"结果本身、松弛、把事情落地",兄弟:"同辈、分利、竞争"},o={日生:"日辰生它,当天有人托着",日克:"日辰克它,当天被压一头",比和:"与日辰同气,力量相当",日合:"与日辰相合,黏住了",日冲:"与日辰相冲,当天就动"};function h(a){if(!a)return"";const b=[],D=$[a.monthState]||a.monthSay||"";D&&b.push(`月令${a.monthState||""}(${D})`);const ee=o[a.dayRelation]||a.daySay||"";return ee&&b.push(ee),a.kong&&b.push("旬空——抓不实,等冲或填"),a.moving&&b.push("发动,是这件事的动因"),a.monthChong&&b.push("月破,先破后立"),b.join(";")}function d(a){const b=a.hexStrength&&a.hexStrength.lines||[];if(!b.length)return null;const D=b.find(ce=>ce.shi)||null,ee=b.find(ce=>ce.ying)||null,S=a.body||{},T=S.ben||{},L=S.bian||{},K=a.cast&&a.cast.movingPositions||[],Q=b.filter(ce=>ce.moving),oe=String(a.question||"").trim(),ie=s([...S.labels||[],...a.hexStrength&&a.hexStrength.labels||[]]),ue=a.hexStrength&&a.hexStrength.month?a.hexStrength.month.branch:"",U=[T.chong?"六冲卦:事情容易散、节奏快":"",T.he?"六合卦:事情黏住、快不起来":"",S.fuYin&&(S.fuYin.inner||S.fuYin.outer)?"有伏吟:原地打转":"",S.fanYin&&(S.fanYin.inner||S.fanYin.outer)?"有反吟:来回反复":""].filter(Boolean);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([T.name,L.name?`变${L.name}`:"",K.length?`${K.length} 爻动`:"静卦",ue?`${ue}月`:""]),lead:`${oe?`你问的是「${oe}」。`:""}本卦「${T.name||"—"}」${L.name?`,${K.length?`第 ${K.join("、")} 爻动`:"六爻安静"},变「${L.name}」`:""}。方向还留在「综合」,所以这一卦没有取用神——先只讲与问题无关的那几样:你(世爻)、事情(应爻)、卦体。`,sections:[{h:"代表你的是",t:D?`世爻在${D.name}(${D.branch}${D.element}·${D.liuqin}):${h(D)||"状态平稳"}。`:"这一卦取不到世爻。"},{h:"代表事情的是",t:ee?`应爻在${ee.name}(${ee.branch}${ee.element}·${ee.liuqin}):${h(ee)||"状态平稳"}。应爻说的是「事情那一头」的状态,不是你努力的程度。`:"这一卦取不到应爻。"},{h:"卦体与动爻",t:`${U.length?`${U.join(";")}。`:"没有六冲、六合、伏吟、反吟这类整体结构。"}${Q.length?`动爻在${Q.map(ce=>`${ce.name}(${ce.liuqin})`).join("、")}——动的地方,就是这件事会发生变化的那一环。`:"六爻安静:眼下没有明显在动的地方,说明事情的节奏还没起来。"}`}],advice:["先在上面选一个「询问方向」(工作、感情、生意、推进、择日):选完才会取用神,旺衰、应期、成败条件才有落点。",...(H.other&&H.other.reality||[]).slice(0,2)].filter(Boolean),caveat:"未指定所问之事:这一版只读世应、卦体与动爻,不判成败,也不给应期——不是算不出来,是取用神要先知道问什么。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function y(a){const b=a.useGod||{};if(!b.liuqin)return d(a);const D=b.found||[];if(!D.length&&!b.missing)return null;const ee=String(a.question||"").trim(),S=a.useGodStrength&&a.useGodStrength.lines||[],T=te=>S.find(ye=>ye.position===te)||null,K=(a.hexStrength&&a.hexStrength.lines||[]).find(te=>te.shi)||null,Q=a.useGodStrength&&a.useGodStrength.month?a.useGodStrength.month.branch:"",oe=a.dayGanZhi&&a.dayGanZhi.name||"",ie=D.map(te=>te.name).join("、"),ue=`${ee?`你问的是「${ee}」。`:"你没填具体问题,这里按「综合」取用神,结论会更粗。"}这卦里代表它的是「${b.liuqin}」(${b.ask||""}),`+(D.length?`落在${ie}${D.length>1?"——两处都出现了,两个条件要一起看":""}。`:"盘中看不见它(伏藏),要等冲开或引出才有动静。")+`日辰是${oe||"—"},月建是${Q||"—"}。`,U=[],ce=[];for(const te of D){const ye=T(te.position);ye&&(/旺|相/.test(ye.monthState||"")&&!ye.kong&&!ye.monthChong&&U.push(te.name),(/日克|日冲/.test(ye.dayRelation||"")||ye.kong||ye.monthChong)&&ce.push(te.name))}const le=D.length?U.length>ce.length?"条件偏有利":ce.length>U.length?"条件偏紧,得有外力或时间":"一半一半,取决于你怎么推":"没有可判的落点",be=s([...(b.labels||[]).filter(te=>/两现|伏藏|六合|六冲/.test(te)),a.body&&a.body.ben&&a.body.ben.chong?"六冲卦:事情容易散,节奏偏快":"",a.body&&a.body.ben&&a.body.ben.he?"六合卦:事情黏住,快不起来":""]),Ne=s((a.yingqi&&a.yingqi.items||[]).map(te=>te.branch)).slice(0,4);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([a.ben&&a.ben.name,`用神 ${b.liuqin||""}`,Q?`${Q}月`:"",a.yingqi?a.yingqi.tempo:""]),lead:ue,sections:[{h:"代表你的是",t:K?`世爻在${K.name}(${K.branch}${K.element}·${K.liuqin}):${h(K)||"状态平稳"}。`:"这一卦的世爻取不到,先看用神那一条。"},{h:"代表这件事的是",t:D.length?D.map(te=>`${te.name} ${te.ganzhi}(${te.liuqin}):${h(T(te.position))||"没有明显的月日冲克"}。`).join(""):"用神伏藏:盘中看不见它,说明这件事现在还不在明面上,要等一个引子。"},{h:"成不成看哪里",t:`把用神的月令与日辰放在一起,盘面给的是「${le}」。${be.length?`另有:${be.join(";")}。`:""}`}],advice:[...(H[I(b.direction)]&&H[I(b.direction)].reality||[]).slice(0,2),Ne.length?`应期只看地支:${Ne.join("、")}——地支只是「往哪个方向等」,不是公历日期。`:""].filter(Boolean),caveat:s([D.length>1?`用神两现(${ie}):本插件不替你二选一,两处条件一起看。`:"",b.missing?"用神伏藏:先看伏神与飞神的关系,再看有没有东西把它冲出来。":"","世应只说明「你」和「事」的相对位置,不直接等于吉凶。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function x(a){const b=a.bodyUse;if(!b||!b.body||!b.use)return null;const D=String(a.question||"").trim();return{system:"meihua",title:"先看这一卦:方向大致在哪",chips:s([a.ben&&a.ben.name,a.bian&&`变${a.bian.name}`,b.relation?`体用 ${b.relation.split("(")[0]}`:""]),lead:`${D?`你问的是「${D}」。`:""}本卦「${a.ben&&a.ben.name}」,动在第 ${a.moving} 爻,变卦「${a.bian&&a.bian.name}」。体卦 ${b.body.trigram}(${b.body.element})代表你,用卦 ${b.use.trigram}(${b.use.element})代表这件事:${b.relation}。`,sections:[{h:"过程与结果",t:`过程看互卦「${a.hu&&a.hu.name||"—"}」,结果看变卦「${a.bian&&a.bian.name||"—"}」。梅花给的是方向,不是细节——它不会告诉你几号、多少钱。`},{h:"盘面给的分量",t:`这一卦的体用关系被标成「${b.level}」。注意:这是条件层面的判断,不是结果已经发生;条件好但不动,一样没有结果。`}],advice:["把它当「换个角度看这件事」:体用只分「谁在给、谁在耗」,剩下要你自己补具体动作。","如果要推进,先定一个最小动作(打个电话、发条消息),别等条件齐了再动。"],caveat:"梅花取象的自由度大:同一卦,不同人读出的细节可以不同。本插件只取体用生克这一层。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function M(a){const b=a.sanChuan||{};if(!b.chu||!b.zhong||!b.mo)return null;const D=String(a.question||"").trim(),ee=T=>`${T.zhi}(${T.liuQin||""}·${T.jiangFull||""})`,S=T=>g[T.liuQin]?`——${g[T.liuQin]}`:"";return{system:"daliuren",title:"先看这一课:事情怎么走到这一步",chips:s([a.geJu&&a.geJu.name,`${b.chu.zhi}→${b.mo.zhi}`,a.yueJiang&&`月将${a.yueJiang.zhi}`]),lead:`${D?`你问的是「${D}」。`:""}三传是 ${b.chu.zhi} → ${b.zhong.zhi} → ${b.mo.zhi};末传落 ${b.mo.zhi}(${b.mo.liuQin||""}·${b.mo.jiangFull||""}),课体是「${a.geJu&&a.geJu.name||"—"}」。`,sections:[{h:"起手(初传)",t:`${ee(b.chu)}${S(b.chu)}。这是事情开头的样子。`},{h:"转折(中传)",t:`${ee(b.zhong)}${S(b.zhong)}。中间会经过这一段,也是容易改道的地方。`},{h:"落点(末传)",t:`${ee(b.mo)}${S(b.mo)}。末传比初传更接近结果——但也只是「照现在这样走下去会到哪」。`}],advice:["先看初传:事情是从哪儿起的?把那个起点找出来,比猜结果有用。","中传若与初传相冲相克,说明中途会变;这时别把计划定死。"],caveat:"三传讲的是传变形态,不给具体日期;同一课不同流派对课体的命名也有差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function O(a){const b=a.siZhu&&a.siZhu.day?String(a.siZhu.day)[0]:"",D=a.siZhu&&a.siZhu.time?String(a.siZhu.time)[0]:"",ee=a.palaces||[];if(!ee.length)return null;const S=U=>ee.find(ce=>ce.tianPan===U)||(a.centerPalace&&a.centerPalace.tianPan===U?a.centerPalace:null),T=S(b),L=S(D),K=String(a.question||"").trim(),Q=U=>{const ce=U&&Y[U.palace]&&Y[U.palace].field;return ce?ce.split(":")[0]:U?`${U.palace}宫`:"盘中取不到"},oe=U=>U&&Y[U.palace]&&Y[U.palace].dir?`(${Y[U.palace].dir})`:"",ie=U=>U?`${Q(U)}${oe(U)}|${U.gate||"—"}·${U.star||"—"}·${U.god||"—"}`:"盘中取不到",ue=U=>!U||!U.gateRelation||!U.gateRelation.type?"门与宫的关系没算到":`${U.gateRelation.type}(${U.gateRelation.note||""})`;return{system:"qimen",title:"先看这一局:条件和位置在哪",chips:s([a.ju,a.zhiFu&&`值符${a.zhiFu.star}`]),lead:`${K?`你问的是「${K}」。`:""}日干 ${b} 落在${ie(T)},时干 ${D} 落在${ie(L)}——前者代表你,后者代表这件事。你这边门与宫是${ue(T)};事情那边是${ue(L)}。`,sections:[{h:"你这边的条件",t:T?`你在${Y[T.palace]?Y[T.palace].field:T.palace+"宫"};门是${T.gate||"—"}——${q[T.gate]||"门名只说明形态"}。`:"日干落在中宫或取不到:中宫无门无神,按寄宫(多寄坤二)取用,读的时候要说清这是寄宫。"},{h:"事情那边的条件",t:L?`事情落在${Y[L.palace]?Y[L.palace].field:L.palace+"宫"};门是${L.gate||"—"}——${q[L.gate]||"门名只说明形态"}。`:"时干落在中宫或取不到,同样按寄宫看,别当成坤二本宫。"},{h:"门名不是吉凶",t:"开门主启动、生门主生长、休门主等待、伤门主损耗、杜门主隐藏——这些说的是「这件事现在是什么形态」,不是好坏判决。要看它与日干宫、时干宫的生克。"}],advice:["把「我这边」和「事情那边」的宫位对一下:两边相距越远,越需要中间人、流程或时间。","如果门名是伤门、死门,不是叫你别做,而是提醒这件事的代价和收尾要先想清楚。"],caveat:s([a.juMethodNote||"","奇门重方位与时机;本插件不给具体方位建议,只把宫位与门星神摊开。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function G(a){const b=a.cards||[];if(!b.length)return null;const D=String(a.question||"").trim(),ee=b.find(S=>/现在|现况|当下|建议|核心/.test(S.position||""))||b[Math.floor(b.length/2)];return{system:"tarot",title:"先看这几张牌:它们各在说什么",chips:s([a.spread]),lead:`${D?`你问的是「${D}」。`:""}${a.spread||""}:`+b.map(S=>`${S.position}「${S.name}」${S.orientation}`).join(",")+"。",sections:b.slice(0,4).map(S=>({h:S.position,t:`「${S.name}」${S.orientation}:${(S.keywords||[]).slice(0,3).join("、")||S.core||""}。${S.image?`牌面上${S.image}。`:""}${S.astro?`占星对应是${S.astro}。`:S.role?`它在盘上顶的是「${S.role}」那个角色。`:""}${S.positionHint||""}`})),advice:[`最值得先看的是「${ee.name}」(${ee.position}·${ee.orientation})——${(ee.keywords||[]).slice(0,3).join("、")||"它所在的位置,就是这件事现在的着力点"}。`,"把牌当镜子:它给的是看事情的角度,不是判决。看完写一句「那我下一步做什么」。"],caveat:a.systemNote||"塔罗为象征系统,牌义与元素对应存在流派差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function se(a){const b=a.score;if(!b)return null;const D=(a.dimensions||[]).filter(L=>L&&L.text),ee=L=>{const K=L&&L.dayMaster;return K?typeof K=="string"?K.replace(/日主$/,""):`${K.stem||""}${K.element||""}`:""},S=ee(a.a),T=ee(a.b);return{system:"hepan",title:"先看这一张:你们大致怎么相处",chips:s([S&&T?`${S} × ${T}`:"",b.level,`${b.total}/100`]),lead:`${S&&T?`你们是 ${S} 与 ${T}。`:""}合盘描述的是「相处方式与互补点」,不判合不合,也不决定关系成败。整体上盘面给的是「${b.level}」(${b.total}/100——分数只是相对刻度,不是及格线)。`,sections:D.slice(0,3).map(L=>({h:L.label,t:L.text})),advice:["一起看,别一个人看完拿去判断对方:前者是对话,后者是审判。","把上面的分歧当话题清单:哪一条你们真的在意,就聊哪一条。"],caveat:a.notes&&a.notes[0]||"合盘看的是相处方式与互补点,不决定关系成败。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function C(a){const b=a.points||[],D=a.segments||[];if(!b.length||!D.length)return null;const ee=Number.isInteger(a.meta&&a.meta.nowYear)?a.meta.nowYear:null,S=ee&&b.find(le=>le.year===ee)||null,T=S&&D.find(le=>S.age>=le.startAge&&S.age<=le.endAge)||D[0],L=D[D.indexOf(T)+1],K=b.filter(le=>le.age>=T.startAge&&le.age<=T.endAge),Q=K.length?K.reduce((le,be)=>le+be.score,0)/K.length:0,oe=b.reduce((le,be)=>le+be.score,0)/b.length,ie=Q>=oe+5?"比一生平均更亮":Q<=oe-5?"比一生平均更闷":"与一生平均差不多",ue=a.highlights&&a.highlights.best||[],U=a.highlights&&a.highlights.worst||[],ce=S?`你现在 ${S.age} 岁(${ee} 年),在「${T.ganZhi}」这一步的第 ${S.age-T.startAge+1} 年(${T.startAge}–${T.endAge} 岁)${L?`,再过 ${T.endAge-S.age+1} 年到 ${L.startAge} 岁换「${L.ganZhi}」`:",已是最后一步"}。`:`没给当前日期(asOf),所以不标「现在在第几步」;先看第一步「${T.ganZhi}」(${T.startAge}–${T.endAge} 岁)起手的样子。`;return{system:"trend",title:"先看这一条线:这些年大致什么走势",chips:s([T.ganZhi,`${T.startAge}–${T.endAge} 岁`,S?`${S.age} 岁`:""]),lead:`这条线按 ${a.meta&&a.meta.toAge||b.length} 岁排到 ${b[b.length-1].year} 年,共 ${D.length} 步大运。`+ce,sections:[{h:"这一步的基调",t:`这一步里各年的平均分是 ${Q.toFixed(0)},${ie}(全盘平均 ${oe.toFixed(0)})。分数是相对刻度,不是绝对值。`},{h:"这些年里最亮和最闷的",t:`${ue.length?`高点:${ue.slice(0,2).join("、")}`:"没有特别高的点"};${U.length?`低点:${U.slice(0,2).join("、")}`:"没有特别低的点"}。高点适合推进,低点适合收口。`},{h:"怎么用这条线",t:"它不是命运表,是把「顺/不顺」画成可视的起伏。真正决定走向的,是你在这几步里做了什么。"}],advice:["把下一步换运的年龄记下来:换运前后半年,通常是最容易做决定、也最容易冲动的时候。","低点年别做大额投入,高点年别只观望——这两条比记分数管用。"],caveat:"线按年岁等距绘制,实际每步大运十年;起点与交运按节气推算,出生时刻未知时按日估算。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function X(a){const b=a.taiyi,D=[{h:"太乙落在哪一宫",t:`${b.palaceName}宫(${b.dir}),这是三年里的第 ${b.yearInPalace} 年,对应「${b.li}」。太乙三年换一宫,走的是八宫、不入中五,所以在盘面上永远看不到它落在中间。`},{h:"八门这三十年",t:`${a.gate.gate}。八门三十年一转,1954 年从休门起,顺序是休、生、伤、杜、景、死、惊、开,所以一个门要值三十年,不是每年都换。`},{h:"文昌在哪",t:`文昌在${a.wenchang.pos}(${a.wenchang.god},${a.wenchang.palaceName}宫)。文昌十八年一周,阳局从申起、阴局从寅起,路上遇乾、坤各数两次,所以要数满十八步才回到原点。`},{h:"这一盘算到哪一层",t:`积年 ${a.meta.jinian},残年 ${a.meta.rest360},${a.meta.dunText}${a.meta.ju}局。太乙、八门、文昌三个落点是齐的;${a.scope.notCovered.slice(0,2).join("、")}这几项没有收录,盘面上也不显示。`}];return{system:"taiyi",title:"先看这一张",chips:[`${a.meta.year}年`,`${a.meta.dunText}${a.meta.ju}局`,`${b.palaceName}宫`].filter(Boolean),lead:`${a.meta.year} 年太乙:${a.meta.dunText}${a.meta.ju}局,太乙临 ${b.palaceName} 宫(${b.dir}),八门值 ${a.gate.gate}。`,sections:D,advice:[`先看太乙落在哪:${b.palaceName}宫${b.dir},这三年的大方向就在这一格,别拿它当每年的细节来读。`,`八门十年一变的说法常被混用,这里按三十年一转的口径——${a.gate.gate}值这三十年,不是今年才轮到。`,"太乙是象数盘,给的是位置的对应关系,不是「今年会发生什么」的判决。"],caveat:`这一层只到太乙、八门、文昌三个落点;${a.scope.notCovered.join(";")}都未收录,别按它们解读。`,footer:"太乙年家用积年推局,与八字按立春换年、运气按大寒分年都不同口径,三套不要互相印证。"}}function me(a){const b=[];a.special.taiYi&&b.push("太乙天符"),a.special.tianFu&&!a.special.taiYi&&b.push("天符"),a.special.suiHui&&!a.special.taiYi&&b.push("岁会"),a.special.tongTianFu&&b.push("同天符"),a.special.tongSuiHui&&b.push("同岁会");const D=[{h:"这一年的气候底色",t:a.combo.text},{h:"此刻在哪个运、哪口气",t:a.current.text},{h:"被强调的脏腑",t:`中运主${a.zhongyun.organ}:传统上这样描述——${a.zhongyun.effect.organ}。${a.zhongyun.effect.sign}`},{h:"今年常被说到的身体反应",t:`上半年(${a.sitian.qi}司天):${a.sitian.climate.sign};下半年(${a.zaiquan.qi}在泉):${a.zaiquan.climate.sign}`}];return{system:"wuyunliuqi",title:"先看这一张",chips:[`${a.year.ganzhi}年`,a.zhongyun.name,`${a.sitian.qi}司天`].filter(Boolean),lead:`${a.year.ganzhi} 运气年:中运${a.zhongyun.name},${a.sitian.qi}司天、${a.zaiquan.qi}在泉。`,sections:D,advice:[`顺着「${a.zhongyun.nature}」来调:${a.zhongyun.tai?"本气偏胜,别再加码,先把被克的那一头护住":"本气不足,别硬扛,先补本气再谈其他"}。`,`这一年偏「${a.sitian.climate.climate}」,起居上按这个方向做减法,比按季节硬套更贴。`,"运气盘给的是「今年偏什么」,不是「你会得什么病」;有具体不适看医生。"],caveat:b.length?`特殊格局:${b.join("、")}。${a.special.notes.join("")}`:"这一年在格局上没有天符、岁会那一类标记,按中运与司天在泉的常例读就好。",footer:"运气年以大寒为界,与八字按立春定年柱不同;两套口径不要互相印证。"}}function $e(a){const b=a.primary,D=[];b&&(D.push({h:b.name+"是什么",t:(b.oneLine||"")+(b.trait?" "+b.trait:"")}),b.tendency&&D.push({h:"容易被影响的地方",t:b.tendency}));const ee=(a.top||[]).find(S=>b&&S.name!==b.name);return ee&&D.push({h:"次高的一项",t:`${ee.name} ${ee.converted} 分(${ee.level})——它常和主质一起出现,调的时候顺手带上。`}),{system:"constitution",title:"先看这一张",chips:[b?b.name:"未判定",a.pinghe?`平和 ${a.pinghe.converted}`:"",a.meta?`${a.meta.answered}/${a.meta.total} 题`:""].filter(Boolean),lead:b?`主体质是「${b.name}」${b.level==="是"?"":`(${b.level},未完全达判定线)`},转化分 ${b.converted};平和质 ${a.pinghe?a.pinghe.converted:"—"} 分。`:"这份问卷还没答够,先别急着对号入座。",sections:D,advice:(a.care||[]).slice(0,3),caveat:a.flat?"每题都选了同一个选项,问卷对你的区分度不足——主质仅供参考,建议按最近一年的真实感受重答一遍。":"体质是长期倾向,不是病名,也不与八字、星座互证;有具体不适请就医。",footer:"打分为自评,同一个人隔一个月再答可能差一档,看趋势比看单次结果有用。"}}function ze(a){return!a||typeof a!="object"?null:a.system==="bazi"?N(a):a.system==="ziwei"?j(a):a.system==="liuyao"?y(a):a.system==="meihua"?x(a):a.system==="daliuren"?M(a):a.system==="qimen"?O(a):a.system==="tarot"?G(a):a.system==="hepan"?se(a):a.system==="trend"?C(a):a.system==="constitution"?$e(a):a.system==="wuyunliuqi"?me(a):a.system==="taiyi"?X(a):null}return{plainSummary:ze}})(),R.index=(function(){const{buildBazi:P}=R.bazi||{},{buildLiuyao:B,tossLines:F,bodyLabels:H,yongshenOf:Y,yongshenStrength:q,fushenAccess:z,hexagramStrength:I,jinTuiPower:k,yingqiWindow:m}=R.liuyao||{},{buildZiwei:f,BRIGHTNESS:_,flowOf:A,asOfParts:s,ZIWEI_SCHOOL_DEFAULTS:c}=R.ziwei||{},{drawTarot:u,SPREAD_KEYS:N}=R.tarot||{},{buildMeihua:j}=R.meihua||{},{buildDaliuren:$}=R.daliuren||{},{buildHepan:g,tripleOf:o}=R.hepan||{},{buildZiweiHepan:h}=R["ziwei-hepan"]||{},{buildQimen:d,buildSnapshot:y}=R.qimen||{},{geocodeAddress:x,resolveAddress:M}=R.geo||{},{toJDN:O,ganzhiName:G,dayGanzhiIndex:se}=R.calendar||{},{bool:C,canonicalFlags:X,canonicalNumbers:me}=R.bool||{},{randomOf:$e,isSeed:ze}=R.random||{},{encodeHandle:a,decodeHandle:b,resolveHandle:D,pruneForeignKeys:ee,ownedKeys:S}=R.handle||{},{askLink:T,parseAskLink:L,formOf:K,restNote:Q,askPackages:oe}=R.bridge||{},{parseRevision:ie,displayValue:ue}=R.revise||{},{interpret:U,DIRECTIONS:ce,DIRECTION_DEFAULT:le}=R.interpret||{},{followup:be,askPrompt:Ne}=R.followup||{},{crossCheck:te,crossText:ye,crossSection:Ke}=R.crosscheck||{},{pastSignals:Ze,verifyFit:Je}=R.verify||{},{rectifyBirth:Ye}=R.rectify||{},{buildAlmanac:De}=R.almanac||{},{buildZeri:Ie}=R.zeri||{},{buildChenggu:Pe}=R.chenggu||{},{buildXiaoliuren:Ae}=R.xiaoliuren||{},{buildStar:Ee}=R.star||{},{buildNumerology:Ce}=R.numerology||{},{buildMbti:Oe,mbtiPaper:ve}=R.mbti||{},{buildConstitution:we,constitutionPaper:de}=R.constitution||{},{buildWuyunliuqi:Te}=R.wuyunliuqi||{},{buildTaiyi:_e}=R.taiyi||{},{buildConvert:Re}=R.convert||{},{classicsFor:zn,classicsText:Nn,suiyunClassicOf:tn,classicOf:an,CLASSIC_BOOKS:Ge}=R.classics||{},{diffObjects:on,summarize:sn,sortDiffs:rn,labelOf:un,rootOf:ln,categoryOf:cn,formatValue:Ue,CALIBER_SWITCHES:An,viewRows:En}=R.diff||{},{canonicalJson:qt,fingerprintOf:Tn}=R.fingerprint||{},{buildTrend:dn}=R.trend||{},{buildFengshui:He}=R.fengshui||{},{buildName:hn}=R.name||{},{buildTrace:mn,traceMarkdown:fn,SYSTEM_LABEL:On}=R.trace||{},{fail:re}=R.fail||{},{assertCivil:It,MIN_YEAR:$n,MAX_YEAR:yn}=R.validate||{},{parseDateTime:fe,daysInMonth:vn}=R.datetime||{},_t=e=>String(e).padStart(2,"0"),Mn=["male","female"],qn=new Set(["bazi","ziwei","hepan","trend","meihua","daliuren","qimen","name"]),In={bazi:{what:"时柱",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(只排三柱)"},ziwei:{what:"命宫与生时星曜",advice:"紫微排不出三柱,必须补上出生时刻"},hepan:{what:"两侧时柱",advice:"两侧都要出生时刻,合盘才有意义"},trend:{what:"时柱与起运",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(按日估算)"},meihua:{what:"起卦时刻",advice:"时间起卦要用真实起念时刻,请补 HH:mm"},daliuren:{what:"起课时辰(月将与贵人)",advice:"请补起课时刻 HH:mm"},qimen:{what:"起局时辰(旬首与局数)",advice:"请补起局时刻 HH:mm"},name:{what:"时柱",advice:"请补出生时刻 HH:mm"}};function Me(e,t=""){if(Mn.includes(e))return e;const i=e==null||e===""?"(未提供)":`「${e}」`;throw re("E_INPUT",`${t?t+"的":""}gender 必须是 male 或 female${i};性别决定大运/大限顺逆,不能靠默认值`)}const _n=["brightnessSchool","gengYearSihua","tianmaSchool","tiankongSchool","jiekongSchool","kuiyueSchool","tianshiTianshang","changshengSchool","lateZishi","shenzhuSchool","mingzhuSchool","zuoyaoSchool","liunianSihua","sihuaVariant","jieluSchool","suipoSchool"];function pn(e){const t={};for(const i of _n)e[i]!==void 0&&(t[i]=e[i]);return e.schools&&typeof e.schools=="object"&&(t.schools=e.schools),t}function Ln(e){const t=e.pillars,i=(ae,ge)=>`${ae}:${ge.ganzhi} ${ge.stemTenGod?`十神 ${ge.stemTenGod} `:""}藏干 ${ge.hidden.map(qe=>`${qe.stem}(${qe.tenGod})`).join(" ")} 纳音 ${ge.nayin} 地势 ${ge.dishi} 自坐 ${ge.zizuo} 空亡 ${ge.kongwang.join("")}`+(ge.shensha&&ge.shensha.length?` 神煞 ${ge.shensha.join("、")}`:""),n=Object.entries(e.wuxing).map(([ae,ge])=>`${ae}${ge}`).join(" "),l=e.palaces?`【胎元】${e.palaces.taiyuan.ganzhi} 胎息 ${e.palaces.taixi?e.palaces.taixi.ganzhi:"—"}`+(e.palaces.minggong?` 命宫 ${e.palaces.minggong.ganzhi}`:" 命宫 时柱暂缺,不排")+(e.palaces.shengong?` 身宫 ${e.palaces.shengong.ganzhi}`:" 身宫 时柱暂缺,不排"):"",r=e.dayun.list.slice(0,8).map(ae=>`${ae.startAge}岁 ${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}${ae.relations&&ae.relations.length?`[${ae.relations.join("")}]`:""}`).join(" "),p=e.dayun.jiao&&e.dayun.jiao.at?`;交运 ${e.dayun.jiao.at}(${e.dayun.jiao.frame},距${e.dayun.jiao.from.name} ${e.dayun.jiao.spanDays} 天,三日折一年)`:"",w=e.dayun.startAgeExact,E=w&&Number.isInteger(w.years)?`起运岁(精确):${w.years} 年 ${w.months} 个月 ${w.days} 天 ${w.hours} 小时(${w.caliber};上面「${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月」是四舍五入到月,两者同源)`:"",V=e.jieqi.nearBoundaryMinutes<20?`
75
- ⚠ 出生时刻距「节」仅 ${e.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`:"",J={year:"年",month:"月",day:"日",hour:"时"},Z=e.shensha&&e.shensha.groups&&e.shensha.groups.length?`神煞(${e.shensha.count} 见):`+e.shensha.groups.map(ae=>`${ae.cat}|`+ae.items.map(ge=>`${ge.name}(${ge.pillars.map(qe=>J[qe]).join("")})`).join("、")).join(";"):"神煞:—",v=e.renyuan,ne=an("smt-renyuan"),W=v?`人元:${v.month}月第${v.day}日,${v.active}${v.activeElement}司权(${v.segments.map(ae=>`${ae.stem}${ae.from}–${ae.to}`).join(" ")})${v.beyond?";已过 30 日表,按本气算":""}${ne?`|原文见《${Ge[ne.book].name}·${ne.chapter}》`:""}`:"",pe=e.frame&&e.frame.yongshen&&e.frame.yongshen.disputed||[],he=pe.length?` 有争议:${pe.map(ae=>`${ae.element}(${ae.favorRole};${ae.climate}盘调候忌${ae.element})`).join("、")}`:"",Se=new Set(pe.map(ae=>ae.element)),je=e.frame&&e.frame.yongshen&&e.frame.yongshen.neutral||[],Nt=je.length?` 中性偏忌:${je.map(ae=>`${ae.element} ${ae.weight} 分`).join("、")}(近零,不作实忌)`:"",At=e.frame?[`格局:${e.frame.primary?`${e.frame.primary.name}(${e.frame.primary.evidence})`:"—"}`,`   ${e.frame.geju.map(ae=>`${ae.name}[${ae.kind}${ae.status?`·${ae.status}`:""}]`).join(" ")}`,`用神:喜${e.frame.yongshen.favor.join("")}(${e.frame.yongshen.favorTenGods.join("、")}) 忌${e.frame.yongshen.avoid.join("")}(${e.frame.yongshen.avoidTenGods.join("、")})${he}${Nt} ${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}${Se.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(([ae,ge])=>`${ae}${ge}`).join(" ")}`]:[],ke=e.strength&&e.strength.branchStructure,Et=ke?ke.branches.map(ae=>`${ae.label}${ae.branch}${ae.camp}${ke.placeholderHour&&ae.key==="hour"?"·占位":""}`).join("、"):"",Tt=ke&&!ke.placeholderHour&&!ke.complete?" 时柱暂缺,只列三支":"",xn=ke?`地支结构:${ke.placeholderHour?"三支+占位":"四支"} ${ke.code}(${Et}) ${ke.word}${ke.congProb!=null?`(静态从格 ${ke.congRange})`:""}${Tt}`:"",Fe=e.relations&&Array.isArray(e.relations.anhe)?e.relations.anhe:[],kn=Fe.length?`暗合:${Fe.join(" ")}(另列,不并入上面的合冲刑害;${Fe.length===1?"只一对,按口径可忽略":`共 ${Fe.length} 对`})`:"",Ot=e.hourUnknown===!0||!t.hour;return[`【四柱】${t.year.ganzhi} ${t.month.ganzhi} ${t.day.ganzhi}${t.hour?` ${t.hour.ganzhi}`:"(时柱暂缺)"}`,`日主:${e.dayMaster.stem}${e.dayMaster.element}(${e.dayMaster.yinYang}) 空亡:${e.kongwang.join("")}`,i("年柱",t.year),i("月柱",t.month),i("日柱",t.day),...Ot?[]:[i("时柱",t.hour)],`五行:${n}`,...l?[l]:[],`日主强弱:${e.strength.level}(${e.strength.score}) ${e.strength.detail}`,...xn?[xn]:[],...At,`天干关系:${e.relations&&e.relations.stems.length?e.relations.stems.join(" "):"—"}`,`地支关系:${e.relations&&e.relations.branches.length?e.relations.branches.join(" "):"—"}`,...kn?[kn]:[],Z,`真太阳时:${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}`,...W?[W]:[],`大运:${e.dayun.rule}(${e.dayun.direction}),${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月起运${p}`,...E?[E]:[],` ${r}`,`流年:${e.liunian.slice(0,10).map(ae=>`${ae.year}${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}`).join(" ")}`,(()=>{const ae=e.liunian.filter(xe=>xe.suiyun&&xe.suiyun.signals&&xe.suiyun.signals.length);if(!ae.length)return"岁运提示:近十年无岁运并临、运年反吟或大运/流年伏吟、反吟(只标干支,不判吉凶)";const ge=xe=>`${xe.type}${(xe.type.startsWith("流年")||xe.type.startsWith("大运"))&&xe.target?`(${xe.target})`:""}`,qe=tn(e),vt=qe?`|古籍见《${Ge[qe.book].name}·${qe.chapter}》`:"";return"岁运提示(只标干支变动,不判吉凶):"+ae.map(xe=>`${xe.year}${xe.ganzhi} ${xe.suiyun.signals.map(ge).join("/")}`).join(";")+vt})(),"(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)"].join(`
76
- `)+V}function Pn(e){const t=e.lunar.monthRaw||e.lunar.month,i=`${e.lunar.year}年${e.lunar.isLeap?`闰${t}`:e.lunar.month}月${e.lunar.day}日`+(e.lunar.isLeap&&e.lunar.month!==t?`(按${e.lunar.month}月起盘)`:""),n=(()=>{if(!e.schools)return"";const ne=Object.entries({brightnessSchool:"亮度",gengYearSihua:"庚干四化",tianmaSchool:"天马",tiankongSchool:"天空",jiekongSchool:"截空",kuiyueSchool:"魁钺",tianshiTianshang:"天伤天使",changshengSchool:"长生",lateZishi:"晚子时",shenzhuSchool:"身主",mingzhuSchool:"命主取法",zuoyaoSchool:"杂曜全表",liunianSihua:"流年四化取干",sihuaVariant:"十干四化变体",jieluSchool:"截路空亡",suipoSchool:"岁前十二神"}).filter(([W])=>e.schools[W]&&e.schools[W]!==c[W]).map(([W,pe])=>`${pe} ${e.schools[W]}`);return ne.length?`【流派】${ne.join(" ")}`:""})(),l=v=>v.length?v.map(ne=>`${ne.name}${ne.mutagen?`化${ne.mutagen}`:""}`).join(" "):"—",r=v=>`神煞:长生(${v.changsheng}) 博士(${v.boshi}) 将前(${v.jiangqian}) 岁前(${v.suiqi})`,p=[];for(const v of e.palaces){const ne=v.isSoul?"【命】":v.isBody?"【身】":"  ";p.push(` ${v.palace} ${v.branch} ${v.ganzhi} ${ne} 大限${String(v.daxian.start).padStart(2)}-${v.daxian.end} 小限${String(v.xiaoxian.age).padStart(2)} ${l(v.stars)}`),p.push(` ${r(v.shensha)}`)}const w=(e.liunian??[]).slice(0,6).map(v=>` ${v.year} ${v.ganzhi} ${String(v.age).padStart(2)}岁 命宫${v.lifePalace.branch}(${v.lifePalace.palace}) 流禄${v.liulu} 流羊${v.liuyang} 流陀${v.liutuo} | ${v.mutagen.map(ne=>ne.replace("化","")).join(" ")}`+(v.mutagenHits?` 四化落宫 ${v.mutagenHits.map(ne=>`${ne.star}${ne.type}→${ne.palace||"未上盘"}`).join("、")}`:"")+(v.sanfangMainStars?` 三方主星 ${v.sanfangMainStars.join("")}`:"")),E=(e.patterns??[]).length?e.patterns.map(v=>`${v.name}(${v.tone==="good"?"吉格":v.tone==="bad"?"忌格":"中"}:${v.evidence})`).join(";"):"无明显格局(按内置规则)",V=(e.daxianList??[]).slice(0,8).map(v=>` ${v.branch}宫(${v.palace})${v.ages[0]}-${v.ages[1]}岁 ${v.ganzhi} 会${v.mainStars.join("")||"—"} 化 ${v.mutagenHits.map(ne=>`${ne.star}${ne.type}→${ne.palace||"未上盘"}`).join("、")}`),J=(()=>{const v=e.flyChains;if(!v)return"";const ne=pe=>{const he=v[pe];return!he||!he.steps.length?"":`${pe}:${he.path.join("→")}${he.closed?"(成环)":""}`},W=["禄","权","科","忌"].map(ne).filter(Boolean).join(" ");return W?`【命宫飞星】${W}`:""})(),Z=(()=>{const v=e.flyComposite;if(!v||!Array.isArray(v.sources)||!v.sources.length)return"";const ne=v.labels.length?v.labels.join(" · "):"无同宫会聚",W=["禄","权","科","忌"].map(pe=>{const he=(v.byType&&v.byType[pe]||[]).filter(je=>!je.self),Se=[...new Set(he.map(je=>String(je.to).replace(/宫$/,"")))];return Se.length?`${pe}→${Se.join("/")}`:""}).filter(Boolean).join(" ");return`【三方四正飞化】${v.sanfang.join("·")}:${ne}${W?` ${W}`:""}`})();return[`【农历】${i}(月首 ${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.bodyMasterNote?`(${e.bodyMasterSchool==="common"?"子午皆火星":"子铃午火"})`:""}${e.lifeMasterNote?`(${e.lifeMasterNote})`:""}`,`【大限】${e.daxian.rule},${e.daxian.startAge}岁起 【小限】${e.xiaoxianRule.direction}`,n,`【昌曲】文昌${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})`,J,Z,"十二宫:",...p,"大限(按起运年龄排序,前 8 限,宫干四化落宫):",...V,"流年(前 6 年,完整 12 年在结构化数据里):",...w,`【格局】${E}`,e.patternSummary?`【结构统计】吉格 ${e.patternSummary.good.length}、中性 ${e.patternSummary.neutral.length}、忌格 ${e.patternSummary.bad.length}${e.patternSummary.broken.length?`、破格 ${e.patternSummary.broken.length}(${e.patternSummary.broken.join("、")})`:""};${e.patternSummary.note}`:"",e.lunar.note?`注:${e.lunar.note}`:""].filter(Boolean).join(`
77
- `)}const Cn=["旺","相","休","囚","死"];function Rn(e){const t=e.states,i=e.month;if(!t||!i)return"无月令数据";const n=l=>Cn.filter(r=>l&&Array.isArray(l[r])&&l[r].length).map(r=>`${r} ${l[r].join("/")}`).join(" ");return`月令 ${i.branch}(${i.element}) 门 ${n(t.gate)||"—"} 星 ${n(t.star)||"—"} 干 ${n(t.stem)||"—"}`}function Zn(e){const t=e.palaces,i=n=>`${n.palace}宫 ${n.star||"—"}/${n.gate||"—"}/${n.god||"—"}${n.kong?" 空":""}${n.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(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 三奇入墓 ${(e.conditions&&e.conditions.ruMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 六仪入墓 ${(e.conditions&&e.conditions.liuYiRuMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"}`,`【十干克应】${[...t,e.centerPalace].filter(n=>n&&n.ganYing).map(n=>`${n.palace}宫 ${n.ganYing.tian}加${n.ganYing.di} ${n.ganYing.name}`).join(" ")||"—"}`,`【旺衰】${Rn(e)}`,`【九宫】${t.map(i).join(" ")}`,`※ 晚子时:${e.lateZiHourMode==="next-day"?"23:00 后归次日":"23:00 后仍归当日"}(可用 lateZiHourMode / lateZi 指定)`,`※ ${e.rules[e.rules.length-1]}`].join(`
78
- `)}function gn(e){if(!e||!Array.isArray(e.pairs)||!e.pairs.length)return[];const t=["【三方合盘】三对两两并列,不合成「三人总分」",...e.pairs.map(i=>`· ${i.a}–${i.b}:${i.level||"—"}(${i.total==null?"—":`${i.total}/100`})`)];return e.best&&(e.spread>=3?t.push(` 最顺:${e.best.a}–${e.best.b}(${e.best.total}/100)`+(e.hardest?`;最需磨合:${e.hardest.a}–${e.hardest.b}(${e.hardest.total}/100)`:"")):t.push(` 三对分数接近(最高与最低相差 ${e.spread} 分),不排名`)),e.focus&&e.focus.spread>=3&&t.push(` 差异最大的一维:${e.focus.label}(三对相差 ${e.focus.spread} 分)`),e.note&&t.push(`※ ${e.note}`),t}function Yn(e){if(e.chart==="ziwei"){const n=l=>`${l.label}:${l.score>=0?"+":""}${l.score} ${l.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(n),...e.interactions.map(l=>` · ${l.text}`),...gn(e.triple),...e.notes.map(l=>`※ ${l}`)].join(`
79
- `)}const t=n=>`${n.label}:${n.score>=0?"+":""}${n.score} ${n.text}`,i=n=>!n||!n.solarNote?"—":`${n.longitude==null?"未含经度修正":`${n.longitude}°E`}(${n.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||""}`,`真太阳时:你 ${i(e.a)};对方 ${i(e.b)}`,...e.dimensions.map(t),...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(n=>`${n.name}(${n.a}${n.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};分档只数象,总分以上面三维度为准)`]:[],...gn(e.triple),...e.notes.map(n=>`※ ${n}`)].join(`
80
- `)}function Dn(e){const t=e.sanChuan,i=n=>`${n.zhi}(${n.jiang}${n.liuQin}${n.xunKong?"空":""})`;return[`【日时】${e.dayGanZhi}日 ${e.hourZhi}时(${e.dayNight}贵) 月将 ${e.yueJiang.name}${e.yueJiang.zhi} 节气 ${e.jieqi.name} ${e.lateZi===!1?"晚子时不换日":"晚子时换日"}`,`【三传】初 ${i(t.chu)} → 中 ${i(t.zhong)} → 末 ${i(t.mo)}`,`【四课】${e.siKe.map(n=>`${n.position}课 ${n.shang}上${n.xia}下(${n.relation}·${n.jiang})`).join(" ")}`,`【天地盘】${e.pan.map(n=>`${n.di}:${n.tian}(${n.jiang})`).join(" ")}`,`【格局】${e.geJu.name}·${e.geJu.detail}`,...e.shensha&&e.shensha.length?[`【神煞】${e.shensha.map(n=>`${n.name}${n.branch}`).join(" ")}`]:[]].join(`
81
- `)}function Gn(e){const t=[`【起卦】${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}`],i=e.lines.slice().reverse().map(n=>` ${n.name} ${n.yinYang==="阳"?"━━━━━":"━━ ━━"}${n.moving?" ←动":""}`);return[...t,"【爻】",...i].join(`
82
- `)}function Un(e){const t=[e.question?`【所问】${e.question}`:"(未填写提问)",`【牌阵】${e.spread}${e.castAt?` 抽牌于 ${e.castAt}`:""}`];for(const i of e.cards){const n=i.astro?` ${i.astro}`:i.role?` ${i.role}`:"",l=i.en?` [${i.en}]`:"";t.push(` ${i.position}:${i.name}${l}(${i.orientation})${n} ${i.keywords.join("、")}`),i.image&&t.push(`    牌面:${i.image}`)}if(e.reading&&e.reading.length){t.push("【解读】");for(const i of e.reading)t.push(` ${i}`)}return t.join(`
83
- `)}function Hn(e){const t=E=>{const V=E.lines.slice().reverse().map(J=>{const Z=J.position===E.shi?"世":J.position===E.ying?"应":" ";return` ${J.name} ${Z} ${J.symbol} ${J.ganzhi}${J.element} ${J.liuqin}/${J.liushen}`});return[`${E.name}(${E.palace}·${E.palaceElement})`,...V].join(`
84
- `)},i=[`起卦:${e.cast.notation.join("、")}(自下而上)`,`日辰:${e.dayGanZhi.name}`,e.xunShou?`旬首:${e.xunShou} 旬空:${(e.xunKong||[]).join("")||"—"}`:"",e.question?`所问:${e.question}`:"","本卦:",t(e.ben)];e.bian?i.push(`动爻:第 ${e.cast.movingPositions.join("、")} 爻`,"变卦(六亲以变卦自身宫论):",t(e.bian)):i.push("六爻安静,无变卦。");const n=e.body&&Array.isArray(e.body.labels)?e.body.labels:H(e.body);i.push(`卦体:${n.length?n.join(" · "):"无六冲、六合、伏吟、反吟"}`);const l=e.useGod||Y(e,{});if(l&&l.liuqin){const E=l.found.length?l.found.map(ne=>`${ne.position}爻${ne.ganzhi}${ne.element}${ne.kong?"(空)":""}`).join("、"):l.fushen.length?l.fushen.map(ne=>`伏 ${ne.position}爻${ne.ganzhi}${ne.element}(${ne.relation||"飞伏关系未知"})`).join("、"):"不上卦";i.push(`用神:${l.byShi?"世爻":l.liuqin}(${l.ask})→ ${E}${l.side?`(${l.side})`:""}`);const V=l.byShi?"用神 世爻":`用神 ${l.liuqin}`,J=l.labels.filter(ne=>ne!==V&&!ne.startsWith(V));J.length&&i.push(`用神联动:${J.join(" · ")}`);const Z=e.useGodStrength;if(Z&&Z.labels.length){const ne=Z.month&&Z.month.branch?`月建 ${Z.month.branch}(${Z.month.element}) `:"";i.push(`用神旺衰:${ne}${Z.labels.join(" · ")}`)}const v=e.fushenAccess;v&&Array.isArray(v.labels)&&v.labels.length&&i.push(`伏神出伏:${v.labels.join(" · ")}`)}else i.push("用神:未取(未指明所问之事;用「询问方向」指定后即按六亲取用)");const r=e.hexStrength;if(r&&Array.isArray(r.labels)&&r.labels.length){const E=r.month&&r.month.branch?`月建 ${r.month.branch}(${r.month.element}) `:"无月建(未给起卦时间) ";i.push(`全卦旺衰:${E}${r.labels.join(" · ")}`)}const p=e.jinTuiPower;p&&Array.isArray(p.lines)&&p.lines.length&&i.push(`进退力重:${p.lines.map(E=>`${E.position}爻${E.from}→${E.to}${E.type}·${E.verdict}`).join(" · ")}`);const w=e.yingqi;return w&&Array.isArray(w.triggers)&&w.triggers.length&&i.push(`应期线索:${w.tempo} · ${w.triggers.map(E=>`${E.labels.join("/")}${E.branch}`).join(" · ")}(只列地支,不出日期)`),i.filter(Boolean).join(`
85
- `)}function Bn(e){const t=new WeakSet,i=(n,l)=>{switch((n instanceof Number||n instanceof String||n instanceof Boolean)&&(n=n.valueOf()),n&&typeof n=="object"&&typeof n.toJSON=="function"&&(n=n.toJSON(l)),typeof n){case"string":case"boolean":return n;case"number":return Number.isFinite(n)?Object.is(n,-0)?0:n:null;case"bigint":throw new TypeError("Do not know how to serialize a BigInt");case"object":{if(n===null)return null;if(t.has(n))throw new TypeError("Converting circular structure to JSON");t.add(n);let r;if(Array.isArray(n)){r=new Array(n.length);for(let p=0;p<n.length;p++){const w=i(n[p],String(p));r[p]=w===void 0?null:w}}else{r={};for(const p of Object.keys(n)){const w=i(n[p],p);w!==void 0&&(r[p]=w)}}return t.delete(n),r}default:return}};return i(e,"")}const Fn=new Set(["shadow","shadowVersion","diff","trace","traceError","withInterpret","detail","cross","verifyPast","rectify","events","geocode","ask","followup","caliber","seed","asOf","handle","revise","geo","longitudeFromGeo"]),We=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?Number(t.toFixed(6)):null};function Xe(e){if(e==null||e==="")return null;try{const t=fe(e);return{y:t.year,m:t.month,d:t.day,h:t.hour,mi:t.minute,precision:t.precision}}catch{return String(e).trim()}}function Be(e={}){const t={};return e.datetime&&(t.datetime=Xe(e.datetime)),e.gender&&(t.gender=String(e.gender).toLowerCase()),e.longitude!==void 0?t.longitude=We(e.longitude):e.address&&(t.address=String(e.address).trim()),e.lateZi!==void 0&&(t.lateZi=C(e.lateZi,!0)),e.trueSolar!==void 0&&(t.trueSolar=C(e.trueSolar,!0)),e.dst!==void 0&&(t.dst=C(e.dst,!0)),t}function Kn(e){return e.lateZiHourMode==="next-day"||C(e.lateZi)?"next-day":"same-day"}function Jn(e,t){const i=String(t&&t.system||e.system||""),n=t&&t.input&&typeof t.input=="object"?t.input:null;if(i==="bazi"&&n)return{civil:n.civil,gender:n.gender,longitude:We(n.longitude),lateZi:C(n.lateZi,!0),trueSolar:C(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(i==="ziwei"&&n)return{civil:{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute},gender:n.gender,longitude:We(n.longitude),leapMonth:n.leapMonth||"split",leapAsNext:C(n.leapAsNext),schools:n.schools||c,trueSolar:C(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(i==="qimen")return{datetime:Xe(e.datetime),juMethod:e.juMethod||"chaibu",lateZiHourMode:Kn(e)};if(i==="hepan"){const p={chart:e.chart==="ziwei"?"ziwei":"bazi",a:Be({...e,datetime:e.datetime}),b:Be(e.partner||{})};return e.partner2&&(p.c=Be(e.partner2)),p}const l={},r=(p,w)=>Object.defineProperty(l,p,{value:w,enumerable:!0,writable:!0,configurable:!0});for(const[p,w]of Object.entries(e))if(!(Fn.has(p)||w===void 0))if(p==="datetime")r(p,Xe(w));else if(p==="partner")r(p,Be(w));else if(p==="gender")r(p,String(w).toLowerCase());else{if(p==="address")continue;typeof w=="number"?r(p,Number.isFinite(w)?Object.is(w,-0)?0:w:null):typeof w=="string"?r(p,w.trim()):r(p,w)}return i==="daliuren"&&l.lateZi===void 0&&(l.lateZi=!0),i==="tarot"&&l.spread===void 0&&l.count===void 0&&(l.count=3),i==="meihua"&&l.mode===void 0&&(l.mode="time"),i==="xiaoliuren"&&l.mode===void 0&&(l.mode="time"),i==="convert"&&l.mode===void 0&&(l.mode="solar2lunar"),i==="fengshui"&&l.action===void 0&&(l.action="natal"),i==="tarot"&&t&&Array.isArray(t.cards)&&t.cards.length&&(l.cards=t.cards.map(p=>`${p.name||""}|${p.upright?"正":"逆"}`)),i==="liuyao"&&t&&t.cast&&Array.isArray(t.cast.lines)&&(l.cast=t.cast.lines.join("")),l}function Wn(e,t,i=Qe(t.asOf)){const n=t.seed,l=!(n==null||n==="");return e==="liuyao"&&Array.isArray(t.lines)&&t.lines.length===6?{reproducible:!0}:(e==="tarot"||e==="liuyao")&&!l?{reproducible:!1,reason:"未给 seed:重算会变成另一副牌 / 另一卦"}:e==="bazi"||e==="ziwei"||e==="trend"||e==="fengshui"?{reproducible:!0,asOfPinned:!!i}:{reproducible:!0}}function Qe(e){if(e==null||e==="")return null;if(typeof e=="object")return e;const t=String(e).trim();if(!t)return null;const i=s(t);if(!i)return t;const n=r=>String(r).padStart(2,"0");return`${String(i.year).padStart(4,"0")}-${n(i.month)}-${n(i.day)}T${n(i.hour)}:${n(i.minute)}`}function bn(e={},t={}){const i=t.result||null,n=String(i&&i.system||e.system||""),l=String(t.version||typeof globalThis<"u"&&globalThis.__MP_VER||"dev"),r=Qe(e.asOf);return{...Tn({system:n,params:Jn(e,i),seed:e.seed,asOf:r,version:l}),...Wn(n,e,r),system:n,version:l}}const Xn=new Set(["shadow","trace","traceText","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","handle","handleError","revision"]);function wn(e){const t={};for(const[i,n]of Object.entries(e||{}))Xn.has(i)||(t[i]=n);return t}function Qn(e){return!e||!e.shadow||!e.shadow.baseId?null:{snapshot:!0,shadow:e.shadow,data:wn(e)}}function Vn(e,t,i={}){const n=e&&e.shadow,l=t&&t.shadow;if(!n||!l)return{sameId:!1,total:0,reason:"缺少影子盘信息"};if(n.baseId&&l.baseId&&n.baseId!==l.baseId)return{sameId:!1,total:0,fromId:n.id,toId:l.id,fromBaseId:n.baseId,toBaseId:l.baseId,reason:"基础指纹不同,不是同一张盘"};const r=v=>v.snapshot===!0&&v.data&&typeof v.data=="object"?v.data:wn(v),p=on(r(e),r(t)),w=rn(p.filter(v=>ln(v.path))).map(v=>({path:v.path,label:un(v.path),from:Ue(v.from),to:Ue(v.to)})),E=new Map;for(const v of p){const ne=cn(v.path)||"其他";E.set(ne,(E.get(ne)||0)+1)}const V=[...E.entries()].map(([v,ne])=>({name:v,count:ne})).sort((v,ne)=>ne.count-v.count||v.name.localeCompare(ne.name,"zh-Hans-CN")),J=i.fromVersion||n.version||"",Z=i.toVersion||l.version||"";return{sameId:!0,versionChanged:J!==Z,fromVersion:J,toVersion:Z,total:p.length,summary:sn(p),roots:w,categories:V,diffs:p}}function Ve(e={}){let t=D(e),i;if(typeof t.revise=="string"&&t.revise.trim()){const E=ie(t.revise),V={...t};t={...t,...E.patch},i={text:E.text,applied:E.labels.map(J=>{const Z=V[J.key]===void 0?null:V[J.key];return{...J,from:Z,fromDisplay:ue(J.key,Z)}}),ignored:E.ignored},t=ee(t,S(e,E.patch))}if(t=X(t),t=me(t),t.asOf!==void 0&&t.asOf!==null&&t.asOf!==""){const E=Qe(t.asOf);E===null?(t={...t},delete t.asOf):E!==t.asOf&&(t={...t,asOf:E})}if(t.partner2===null&&(t={...t},delete t.partner2),t=jn(t),t.verifyPast!==void 0&&t.verifyPast!==null&&t.verifyPast!==""){const E=Number(t.verifyPast);if(!Number.isInteger(E)||E<1||E>10)throw re("E_INPUT",`verifyPast 要是 1–10 的整数(年数),收到「${t.verifyPast}」`);t={...t,verifyPast:E}}const n=Bn(st(t));if(n&&!n.question&&typeof t.question=="string"&&t.question.trim()&&["liuyao","meihua","daliuren","qimen","tarot","xiaoliuren"].includes(n.system)&&(n.question=t.question.trim()),n)try{const E=zt(n);E&&(n.brief=E)}catch(E){n.briefError=String(E&&E.message||E)}if(i&&(n.revision=i),n&&n.system==="bazi"){n.classics=zn(n);const E=Nn(n.classics);E&&(n.summary=`${n.summary}
70
+ `,F={河北:"石家庄",山西:"太原",内蒙古:"呼和浩特",辽宁:"沈阳",吉林:"长春",黑龙江:"哈尔滨",江苏:"南京",浙江:"杭州",安徽:"合肥",福建:"福州",江西:"南昌",山东:"济南",河南:"郑州",湖北:"武汉",湖南:"长沙",广东:"广州",广西:"南宁",海南:"海口",四川:"成都",贵州:"贵阳",云南:"昆明",西藏:"拉萨",陕西:"西安",甘肃:"兰州",青海:"西宁",宁夏:"银川",新疆:"乌鲁木齐",台湾:"台北"},H={石家庄:[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]},D=(()=>{const A={};for(const s of B.trim().split(`
71
+ `))for(const c of s.split(";")){const u=c.trim().split(/\s+/);if(u.length!==3)continue;const[N,S,$]=u;A[N]={lon:Number(S),lat:Number($)}}for(const[s,[c,u]]of Object.entries(H))A[s]||(A[s]={lon:c,lat:u});return A})(),q=/[省区路街道巷弄号村镇乡组队]/,z={中山区:{city:"大连"},朝阳区:{city:"北京",byProvince:{吉林:"长春",辽宁:"朝阳"}}};function I(A){const s=String(A||"").trim();if(!s)return null;const c=Number(s);if(Number.isFinite(c)&&/^-?\d+(\.\d+)?$/.test(s)&&c>=60&&c<=150)return{lon:c,lat:null,matched:`${c}°E`,level:"经度",note:"按你输入的经度计算"};const u=s.replace(/\s/g,""),N=Object.keys(D).sort((g,o)=>o.length-g.length),S=[];for(const g of N)for(let o=u.indexOf(g);o>=0;o=u.indexOf(g,o+g.length)){const d=u.charAt(o+g.length);q.test(d)||S.push({name:g,at:o,after:d,explicit:d==="市"?1:0})}if(S.sort((g,o)=>o.explicit-g.explicit||g.at-o.at),S.length){const g=S[0],o=D[g.name];return g.after==="县"?{lon:o.lon,lat:o.lat,matched:`${g.name}县`,level:"区县",note:`「${g.name}县」按 ${g.name} 城区估算(约 ${o.lon}°E)`}:{lon:o.lon,lat:o.lat,matched:g.name,level:"地级市",note:`按 ${g.name} 估算(约 ${o.lon}°E)`}}for(const[g,o]of Object.entries(z)){if(!u.includes(g))continue;let d=o.city;for(const[y,x]of Object.entries(o.byProvince||{}))if(u.includes(y)){d=x;break}const h=D[d];if(h)return{lon:h.lon,lat:h.lat,matched:d,level:"区县",note:`「${g}」按 ${d} 估算(约 ${h.lon}°E)`}}const $=N.find(g=>u.includes(`${g}路`)||u.includes(`${g}街`));if($)return{lon:null,lat:null,matched:null,level:"未匹配",note:`「${$}路」是全国常见的路名,无法确定城市;请补上城市(如「厦门市${$}路」)或直接填经度`};for(const[g,o]of Object.entries(F)){const d=u.indexOf(g);if(d<0)continue;const h=u.charAt(d+g.length);if(h==="区"||h==="县")continue;const y=D[o]||{lon:H[o][0],lat:H[o][1]};return{lon:y.lon,lat:y.lat,matched:o,level:"省会",note:`未匹配到具体城市,按 ${g} 省会 ${o} 估算(约 ${y.lon}°E)`}}return{lon:null,lat:null,matched:null,level:"未匹配",note:`没查到「${s}」,可改填经度(如 116.4)`}}const k=/(区|县|镇|乡|村|小区|街道|路|号|巷|弄|组|队)/,m="dsh-metaphysics (+https://github.com/xuanfu-web/dsh-metaphysics)";async function f(A,{timeoutMs:s=2500}={}){if(typeof fetch!="function")return null;let c=null;try{const u=typeof AbortController=="function"?new AbortController:null;u&&(c=setTimeout(()=>u.abort(),s));const N="https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&accept-language=zh-CN&countrycodes=cn&q="+encodeURIComponent(A),S=await fetch(N,{signal:u?u.signal:void 0,headers:{"User-Agent":m}});if(!S||!S.ok)return null;const $=await S.json();if(!Array.isArray($)||$.length===0)return null;const g=$[0],o=Number(g.lon),d=Number(g.lat);return Number.isFinite(o)?{lon:o,lat:d,matched:g.display_name,level:"在线",note:`在线解析:${g.display_name}`}:null}catch{return null}finally{c&&clearTimeout(c)}}async function L(A,s={}){const c=I(A),u=String(A||"").trim();if(!u||!P(s.online)||c&&typeof c.lon=="number"&&!k.test(u))return c;const S=await f(u,s);return S?{...S,local:c&&c.lon!=null?c:null}:c&&typeof c.lon=="number"?{...c,onlineFailed:!0,note:`${c.note}(联网解析失败或超时,已退回内置坐标表)`}:{...c,onlineFailed:!0}}return{CITIES:D,PROVINCES:F,resolveAddress:I,geocodeAddress:L}})(),R.random=(function(){function P(z){const I=Number(z),k=I>>>0,m=Math.floor(Math.abs(I)/4294967296)>>>0,f=Math.round((I-Math.trunc(I))*4294967296)>>>0;let L=(k^Math.imul(m+1,2246822507)^f)>>>0;return L||(L=2654435769),function(){L=L+1831565813>>>0;let s=L;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}function B(){const z=globalThis.crypto;if(!z||typeof z.getRandomValues!="function")return Math.random;const I=128,k=new Uint32Array(I);let m=I;const f=()=>(m>=I&&(z.getRandomValues(k),m=0),k[m++]/4294967296);return f.source="crypto",f}const F=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/,H=z=>{if(typeof z=="number")return Number.isFinite(z)?z:NaN;if(typeof z=="string"){const I=z.trim();if(I!==""&&F.test(I))return Number(I)}return NaN};function D(z){if(z==null||z==="")return B();const I=H(z);return Number.isFinite(I)?P(I):B()}function q(z){return z==null||z===""?!0:Number.isFinite(H(z))}return{mulberry32:P,randomOf:D,isSeed:q}})(),R.dst=(function(){const{daysInMonth:P}=R.validate||{},B={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"]},F=(z,I,k)=>z*1e4+I*100+k;function H(z){const I=B[z.year];if(!I)return!1;const[k,m,f]=I[0].split("-").map(Number),[L,A,s]=I[1].split("-").map(Number),c=F(z.year,z.month,z.day);if(c<F(k,m,f)||c>F(L,A,s))return!1;const u=z.hour*60+(z.minute||0);return!(c===F(k,m,f)&&u<120||c===F(L,A,s)&&u>=120)}function D(z){const I=B[z.year];if(!I)return null;const[k,m,f]=I[0].split("-").map(Number),[L,A,s]=I[1].split("-").map(Number),c=F(z.year,z.month,z.day),u=z.hour*60+(z.minute||0);return c===F(k,m,f)&&u>=120&&u<180?"gap":c===F(L,A,s)&&u>=60&&u<120?"twice":null}function q(z){const I=z.minute||0;if(!H(z))return{year:z.year,month:z.month,day:z.day,hour:z.hour,minute:I,applied:!1,note:null};let{year:k,month:m,day:f,hour:L}=z;L-=1,L<0&&(L+=24,f-=1,f<1&&(m-=1,m<1&&(m=12,k-=1),f=P(k,m)));const A=D(z);return{year:k,month:m,day:f,hour:L,minute:I,applied:!0,note:`检出自 ${B[z.year][0]} 至 ${B[z.year][1]} 的中国夏令时:出生钟面时间已减 1 小时校正`+(A==="gap"?";这一天 02:00–03:00 钟表直接跳过,所给钟面时间在当年并不存在——这里按「拨快后的读数」回退一小时,若登记的本是标准时间,请传 dst:false 重排。":A==="twice"?";这一天 01:00–02:00 因回拨走了两遍,同一钟面时间对应两个真实时刻——这里按夏令时的那一遍(回退一小时)取。":"")}}return{DST_SPANS:B,inDstSpan:H,dstAmbiguity:D,applyDst:q}})(),R.classics=(function(){const P={ziping:{name:"子平真诠",author:"清·沈孝瞻",base:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/"},ditian:{name:"滴天髓",author:"明·京图(通行本)",base:"https://www.diancang.xyz/xuanxuewushu/ditiansui/"},sanming:{name:"三命通会",author:"明·万民英",base:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/"}},B=[{id:"zp-yongshen",book:"ziping",chapter:"八、论用神",scene:"用神",tags:[],quote:"八字用神,专求月令,以日干配月令地支,而生克不同,格局分焉。财官印食,此用神之善而顺用之者也;煞伤劫刃,用神之不善而逆用之者也。",plain:"用神从月令里找:财、官、印、食四吉神顺用(生之护之),煞、伤、劫、刃四凶神逆用(制之化之)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53628.html"},{id:"zp-zhenguan",book:"ziping",chapter:"三十一、论正官",scene:"格局",tags:["正官"],quote:"以刑冲破害为忌,则以生之护之为喜矣。存其喜而去其忌则贵,而贵之中又有高低者,何也?",plain:"正官格最忌刑冲破害,喜财生官、印护官;去忌存喜才谈得上贵,贵的层次还要看财印是否并透、有无伤官七煞混杂。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53651.html"},{id:"zp-cai",book:"ziping",chapter:"三十三、论财",scene:"格局",tags:["财","正财","偏财"],quote:"财为我克,使用之物也,以能生官,所以为美。为财帛,为妻妾,为才能,为驿马,皆财类也。",plain:"财是我所克、能为我用之物,因能生官而美;它同时代表钱财、配偶、才能、走动,不只「钱」一项。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53653.html"},{id:"zp-yin",book:"ziping",chapter:"三十五、论印绶",scene:"格局",tags:["印"],quote:"印绶喜其生身,正偏同为美格,故财与印不分偏正,同为一格而论之。",plain:"印能生身,正印偏印都算美格,不分偏正而论;印格的关键在身印强弱与官杀、食伤、财的配合。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53655.html"},{id:"zp-shishen",book:"ziping",chapter:"三十七、论食神",scene:"格局",tags:["食神"],quote:"食神本属泄气,以其能生正财,所以喜之。故食神生财,美格也。财要有根,不必偏正叠出,如身强食旺而财透,大贵之格。",plain:"食神本是泄气,可贵在能生财;食神生财要财有根,身强、食旺、财透三者齐,格局才大。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53657.html"},{id:"zp-pianguan",book:"ziping",chapter:"三十九、论偏官",scene:"格局",tags:["七杀","偏官"],quote:"煞以攻身,似非美物,百大贵之格,多存七煞。盖控制得宜,煞为我用,如大英雄大豪杰,似难驾驭,而处之有方,则惊天动地之功,忽焉而就。",plain:"七煞攻身,看着不美,但大贵之格多有七煞——能控制住就为我所用,像驾驭豪杰,处之有方就能成大事。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53659.html"},{id:"zp-shangguan",book:"ziping",chapter:"四十一、论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽非吉神,实为秀气,故文人学士,多于伤官格内得之。而夏木见水,冬金见火,则又为秀之尤秀者也。",plain:"伤官不是吉神,却是秀气所在,文人多出伤官格;夏木得水、冬金得火,是秀气里更秀的两种。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53661.html"},{id:"zp-yangren",book:"ziping",chapter:"四十三、论阳刃",scene:"格局",tags:["劫财","阳刃"],quote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之,故为阳刃。不曰劫而曰刃,劫之甚也。刃宜伏制,官煞皆宜,财印相随,尤为贵显。",verifiedQuote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之",variantNote:"典藏网此页把「故为阳刃」刻作「故为旭刃」,与通行本异文;前段仍可逐字核验",plain:"阳刃是劫财之极(只有五阳干有),宜用官煞制伏;财印相随而不相碍,格局更显。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53663.html"},{id:"zp-lujie",book:"ziping",chapter:"四十五、论建禄月劫",scene:"格局",tags:["比肩","建禄","月劫"],quote:"故建禄与月劫,可同一格,不必加分,皆以透干支,别取财官煞食为用。",plain:"建禄、月劫同看一格,月令本身不算用神,要另看透出的财官煞食取用。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53665.html"},{id:"zp-qihou",book:"ziping",chapter:"十四、论用神配气候得失",scene:"调候",tags:[],quote:"论命惟以月令用神为主,然亦须配气候而互参之。譬如英雄豪杰,生得其时,自然事半功倍;遭时不顺,虽有奇才,成功不易。",plain:"月令用神为主,但必须配气候参看;同样的格局,生在得时的气候里事半功倍,逆着气候就费劲。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53634.html"},{id:"zp-chengbai",book:"ziping",chapter:"九、论用神成败救应",scene:"格局",tags:[],quote:"成中有败,必是带忌;败中有成,全凭救应。",plain:"成格不等于一路顺:成中带忌(官逢财又逢伤、官被合之类)就打了折;败格也未必无救——印来解伤、合来清煞,败中还能转成。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53629.html"},{id:"zp-zaji",book:"ziping",chapter:"十六、论杂气如何取用",scene:"用神",tags:[],quote:"何谓透干?如甲生辰月,透戊则用偏财,透癸则用正印,透乙则用月劫是也。何谓会支?如甲生辰月,逢申与子会局,则用水印是也。一透则一用,兼透则兼用,透而又会,则透与会并用。",plain:"四墓(辰戌丑未)所藏不止一气,所以叫杂气:取用先看哪一藏干透到天干,透一个用一个;没有透干,再看地支有没有与月支会成三合局,会成什么局就取局中那一气。透干与会支同时成立时两样并用。原文对「兼透」只给原则,没有给取舍次序。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53636.html"},{id:"zp-bianhua",book:"ziping",chapter:"十、论用神变化",scene:"格局",tags:[],quote:"故若丁生亥月,本为正官,支全卯未,则化为印。己生申月,本属伤官。藏庚透壬,则化为财。凡此之类皆用神之变化也。",plain:"用神本从月令取,但月令藏干不一:丁生亥月本为正官,支会卯未就化为印;己生申月本属伤官,庚藏壬透就化为财。起点相同,合化一变,取用也跟着变(原文只说变化之由,不断定某盘必化)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53630.html"},{id:"dt-hannuan",book:"ditian",chapter:"通神论·寒暖",scene:"调候",tags:[],quote:"天道有寒暖,生育万物,人道行之,不可过也。",plain:"天有寒暖才能生养万物,人命里寒暖也不能过——过寒过热都要调。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zaoshi",book:"ditian",chapter:"通神论·燥湿",scene:"调候",tags:[],quote:"地道有燥湿,生成品汇,人道得之,不可偏也。",plain:"地有燥湿才有品类生成,人命得燥湿之气也不能偏。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shuaiwang",book:"ditian",chapter:"通神论·衰旺",scene:"调候",tags:[],quote:"能知旺衰之真机,其于三命之奥,思过半矣。",plain:"真正看懂旺衰的机关,命理之奥就过了一半——旺衰不是数个数,要看真机。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zhonghe",book:"ditian",chapter:"通神论·中和",scene:"调候",tags:[],quote:"既识中和之正理,而于五行之妙,有全能焉。",plain:"懂得中和的道理,五行的妙处就都在其中了。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-guansha",book:"ditian",chapter:"通神论·官杀",scene:"十神",tags:["正官","七杀"],quote:"官杀混杂来问我,有可有不可。",plain:"官杀混杂不是一律不好,要看能不能去留取清。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shangguan",book:"ditian",chapter:"通神论·伤官",scene:"十神",tags:["伤官"],quote:"伤官见官最难辨,可见不可见。",plain:"伤官见官是最难分辨的一条:有的能见,有的不能见,不能一句「伤官见官为祸百端」了事。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-yueling",book:"ditian",chapter:"通神论·月令",scene:"用神",tags:[],quote:"月令乃提纲之府,譬之宅也,人元为用事之神,宅之定向也,不可以不卜。",plain:"月令像宅子,藏干是用事之神,像宅子的朝向,必须细看。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tiyong",book:"ditian",chapter:"通神论·体用",scene:"用神",tags:[],quote:"道有体用,不可以一端论也,要在扶之抑之得其宜。",plain:"体用不能只看一头,关键是扶抑得宜。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-jingshen",book:"ditian",chapter:"通神论·精神",scene:"用神",tags:[],quote:"人有精神,不可以一偏求也,要在损之益之得其中。",plain:"看精神不能偏执一端,要在损益之间求其中。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tongguan",book:"ditian",chapter:"通神论·通关",scene:"用神",tags:[],quote:"关内有织女,关外有牛郎,此关若通也,相邀入洞房。",plain:"两股力隔着一道关相望:一边织女、一边牛郎,中间若有一行能把两边接上(一方生它、它再生另一方),对峙就化成相生。原文只给取象,哪一行为关要按五行生克定。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"smt-zhenguan",book:"sanming",chapter:"卷五·论正官",scene:"格局",tags:["正官"],quote:"正官者,乃甲见辛、乙见庚之例。阴阳配合,相制有用,成其道也。故正官为六格之首,止许一位,多则不宜。",plain:"正官取「克我而阴阳相配」,有制而能成用;六格以正官居首,只宜一位,多见就杂。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7582.html"},{id:"smt-zhengcai",book:"sanming",chapter:"卷六·论正财",scene:"格局",tags:["财","正财"],quote:"正财者,乃甲见己、乙见戊之例。受我克制,为我之妻,譬人娶妻,妻赍财嫁我,我必精神康强,而后可享用,若衰微不振,虽妻财丰厚,但能目视,终不得用。",plain:"正财是我克制之物,古人以「娶妻带财」作比:自身精神康强才受用得起,身弱不振,财再厚也只是看着。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7645.html"},{id:"smt-piancai",book:"sanming",chapter:"卷六·论偏财",scene:"格局",tags:["财","偏财"],quote:"何谓偏财?乃甲见戊、乙见己之例。非妻所带,乃众人之财也。切忌有姊妹兄弟分夺,柱无官星,祸患百出。",plain:"偏财取「我克而阴阳不同」:不是妻家带来的私财,而是众人之财,宜流通不宜独占。原文最忌比肩劫财来分夺,又说柱中无官星则多事(旧说的重话照录,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7650.html"},{id:"smt-yinshou",book:"sanming",chapter:"卷六·论印绶",scene:"格局",tags:["印"],quote:"印绶者,乃五行生我之名。如甲乙在亥子月,丙丁在寅卯月之类,乃我气之源,为生气,为父母,能护我官星,使无伤克",plain:"印是生我之气,像源头与父母:它能护住官星,使官不受伤克;反过来说,印重就怕财来破。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7655.html"},{id:"smt-shishen",book:"sanming",chapter:"卷六·论食神",scene:"格局",tags:["食神"],quote:"凡命遇财煞之地,食神旺相,煞被食制,不敢为祸,财被食生,充裕不竭,故食神一名寿星,一名爵星,良有以也。",plain:"食神旺,一头制煞、一头生财:煞被制住不敢为祸,财被生起不至枯竭;所以食神又叫寿星、爵星。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7663.html"},{id:"smt-shangguan",book:"sanming",chapter:"卷六·论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽凶,乃我所生,自家之物,伤尽则能生财,财旺则能生官,造化展转有情。",plain:"伤官虽称凶,却是我自己生出来的:伤尽(柱中不见官星)反能生财,财旺再生官,辗转还是有情。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7662.html"},{id:"smt-yangren",book:"sanming",chapter:"卷六·论阳刃",scene:"格局",tags:["阳刃","劫财"],quote:"阳者,阴阳之阳,刃者,刀刃之刃,即禄前一位,言旺越其分,故险。",plain:"阳刃指禄前一位,旺过了本分,所以险;甲丙戊庚壬五阳干才有刃,阴干见伤官同论。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7671.html"},{id:"smt-jianlu",book:"sanming",chapter:"卷六·论建禄",scene:"格局",tags:["建禄","比肩","月劫"],quote:"凡命月令建禄,难招祖业,必主平生见财不聚,却病少寿长,行运再见比肩,克妻妨父损子",plain:"月令建禄是日主临官之地,身旺而财官难取:古说难承祖业、见财不聚,但病少寿长;再走比肩运,古书说克妻妨父损子(属于旧说的重话,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7672.html"},{id:"smt-guansha-liu",book:"sanming",chapter:"卷五·官煞去留杂论",scene:"格局",tags:["七杀","偏官"],quote:"凡看去留,要详柱中官煞孰重孰轻,天干透者易去,月支所藏者难去,须伤官食神去官煞之物众而有力,方才去得。",plain:"官煞混见时先比谁重谁轻:天干透出的容易去,月支藏着的难去;用来去官煞的伤官食神要成众、有根有力,才真去得掉。七杀格遇正官混杂,就按这一篇看取舍。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7599.html"},{id:"smt-quzhi",book:"sanming",chapter:"卷六·曲直",scene:"格局",tags:["曲直格","专旺"],quote:"甲乙日得亥卯未局,柱中须有亥字带印为入格,若无亥有卯,止是木之本气,却要见金土为贵,既无亥字,又无金土,则木不秀不实,难以言贵。",plain:"曲直格要木局成方(亥卯未)且带亥字为印,才算入格;只有卯、没有亥,只是木的本气,得另见金土才谈得上贵;两样都没有,木虽旺而无成,难称贵格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7630.html"},{id:"smt-yanshang",book:"sanming",chapter:"卷六·炎上",scene:"格局",tags:["炎上格","专旺"],quote:"丙丁日遇寅午戌局,柱中须有寅字带印为入格,无寅止是九流近贵之命,若火自旺,无亥水相济,不贵。喜东北方运,忌见辰丑戊己,晦火光明,多主眼疾,或患风气,柱有木制成贵,忌水金乡,怕冲。",plain:"炎上格要火局成方(寅午戌)且带寅字为印才入格;无寅只是偏贵的命。火自旺还要一点水相济,过燥不贵;行运喜东北、忌湿土晦火,也怕冲。原文另带「多主眼疾」一句,属于旧说,本插件只记原文、不作健康判断。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7631.html"},{id:"smt-congge",book:"sanming",chapter:"卷六·从革",scene:"格局",tags:["从革格","专旺"],quote:"庚辛日见巳酉丑局,须带丙丁巳午一二位方成其器,但不可火多。如辛巳、辛酉、辛丑三日不喜五月生,被火所伤,宜八月或水土养育食神印绶为吉。",plain:"从革格是金局成方(巳酉丑),但金要火炼才成器:须带丙丁或巳午一二位,火又不能多。辛巳、辛酉、辛丑三日出身在五月(火旺)被伤,原文说宜八月或水土养育。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7632.html"},{id:"smt-runxia",book:"sanming",chapter:"卷六·润下",scene:"格局",tags:["润下格","专旺"],quote:"壬癸日见申子辰全,忌引卯巳死绝之地,三刑四冲之乡,死绝则不流,冲刑则横流,岁运同。或曰水太泛须柱有土神一两位制之,得成堤岸,既有土怕会木为凶,如有木伤土要金印救解,终是一生成败。",plain:"润下格是水局三合全(申子辰),最忌卯巳死绝与三刑四冲:死绝水不流,冲刑水横流,行运也一样看。水太泛要一两位土作堤,有土又怕木来破堤,木伤土再用金印解救——原文把成败条件摊开讲。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7633.html"},{id:"smt-jiasi",book:"sanming",chapter:"卷六·稼穑",scene:"格局",tags:["稼穑格","专旺"],quote:"赋云:戊己忻逢四季,乃为稼穑之名。是戊己生逢季月,喜见木为官,止得一木为妙,木多则土虚,主虚诈为破家不仁之人。",plain:"稼穑格取戊己生于四季月(辰戌丑未)。原文说喜见一木为官,木多则土虚;后半对木多之人的评语是旧说的重话,本插件只照录条件、不拿来评价人。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7634.html"},{id:"smt-congsha",book:"sanming",chapter:"卷五·弃命从煞",scene:"格局",tags:["从杀格"],quote:"《独步》云:弃命从煞,须要会煞从财,忌煞从煞。盖言从煞格,以煞神太重,身无所归,不得已从之,要行煞旺及财乡,四柱无一点比肩印绶方论,如遇运扶身旺,与煞为敌,从煞不专,故为祸患。",plain:"从煞格是煞太重、日主无所归才「弃命」相从:条件是四柱没有一点比肩印绶扶身,行运喜煞旺与财乡;一旦走扶身之运,与煞为敌,就从得不专。本插件只作结构说明,不据此断寿夭。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7598.html"},{id:"smt-congcai",book:"sanming",chapter:"卷六·弃命从财",scene:"格局",tags:["从财格"],quote:"《独步》云:弃命从财,须要会财,若逢根气,命损无猜。假如丁生酉月,柱多庚辛,日干无气,只得弃命相从,运入北方财官旺地,乃为入格,南行灾。",plain:"从财格要财会成局、日干无气;一见根气就破格,原文用「命损无猜」这种重话写明。以丁生酉月、柱多庚辛为例:只能弃命相从,行北方财官旺地为入格,南行则灾。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7652.html"},{id:"smt-suiyun",book:"sanming",chapter:"卷二·总论岁运",scene:"岁运",tags:[],quote:"行运以生月为运元,最怕行运与太岁冲克,若岁运冲月必祸;若岁运与日相对,谓之返吟,岁运压日,谓之伏吟,二者不利六亲,非横破财,不为吉兆。",plain:"大运以生月为起点,最怕与流年(太岁)冲克:原文说岁运冲月为祸,又把「岁运与日柱相对」叫返吟、「岁运压日」叫伏吟。这两句是按「对日柱」说的,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义(本插件取后者);末句「不利六亲、破财」是旧说的重话,只作变动提示,不作断语。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html"},{id:"smt-renyuan",book:"sanming",chapter:"卷二·论人元司事",scene:"人元",tags:[],quote:"故支吕所藏者主命,谓之人元,名为司事之神,以命术言之为月令。如正月建寅,寅中有艮土用事五日,丙火长生五日,甲木二十日;二月建卯,卯中有甲木用事七日,乙木二十三日;",plain:"地支所藏为「人元」,按月令分日轮值。三命通会这一本给的是另一套日数:寅月艮土(戊土)五日、丙火五日、甲木二十日,卯月甲七日、乙二十三日。它与本插件采用的通行 30 日表(寅月戊7丙7甲16,即 7/7/16;卯月甲10乙20,即 10/20)不是同一套分法;两表各照原样并列,本插件仍按通行表给「第几日谁当权」,不改取格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7529.html"}],F=B.reduce((A,s)=>(A[s.id]=s,A),{}),H={正官格:"正官",七杀格:"七杀",偏官格:"偏官",正财格:"正财",偏财格:"偏财",正印格:"印",偏印格:"印",食神格:"食神",伤官格:"伤官",阳刃格:"阳刃",月劫格:"月劫",建禄格:"建禄"},D={曲直格:"smt-quzhi",炎上格:"smt-yanshang",从革格:"smt-congge",润下格:"smt-runxia",稼穑格:"smt-jiasi",从财格:"smt-congcai",从杀格:"smt-congsha"};function q(A){return F[A]||null}function z(A){return(A&&Array.isArray(A.liunian)?A.liunian:[]).some(u=>u&&u.suiyun&&Array.isArray(u.suiyun.signals)&&u.suiyun.signals.length)?q("smt-suiyun"):null}function I(A){const s=String(A||"");if(H[s])return H[s];const c=s.replace(/格$/,"");return H[c+"格"]||c}function k(A,s){return B.find(c=>c.scene==="格局"&&c.tags.includes(A)&&(!s||c.book===s))||null}function m(A){return A.chapter.replace(/^.*[、·]/,"").replace(/^论/,"")}function f(A,s=5){if(!A)return[];const c=[],u=new Set,N=(v,G)=>{!v||u.has(v.id)||c.length>=s||(u.add(v.id),c.push({...v,why:G}))},S=Array.isArray(A.geju)?A.geju:A.frame&&Array.isArray(A.frame.geju)?A.frame.geju:[],$=S.some(v=>v&&v.kind==="化气格");for(const v of S){if(v&&v.status==="破格"||$&&v&&v.status==="假从")continue;const G=v&&D[v.name]?q(D[v.name]):null;G&&N(G,`本盘列有「${v.name}」,故取${P[G.book].name}「${m(G)}」一条`)}for(const v of S){if(!v||v.kind&&v.kind!=="月令格")continue;const G=I(v.name),se=k(G,"ziping")||k(G);se&&N(se,`你的月令格局是「${v.name}」,故取${P[se.book].name}「${m(se)}」一条`);const C=B.find(Q=>Q.scene==="格局"&&Q.tags.includes(G)&&(!se||Q.book!==se.book));C&&N(C,`同是「${v.name}」,${P[C.book].name}「${m(C)}」另有取法,可对照读`)}const g=A.climate||A.frame&&A.frame.yongshen&&(A.frame.yongshen.climate||A.frame.yongshen.tiaohou),o=A.frame&&A.frame.yongshen&&A.frame.yongshen.tongguan,d=o&&o.usable?q("dt-tongguan"):null;if(g&&g.kind&&g.kind!=="平和"){const v=!!(g.cold||g.kind.indexOf("寒")>=0),G=!!(g.hot||g.kind.indexOf("热")>=0);N(q(v?"dt-hannuan":"dt-zaoshi"),`本盘气候判为「${g.kind}」,故取${P.ditian.name}寒暖燥湿一条`),d||N(q("zp-qihou"),"气候与月令用神要互参,故取子平真诠「用神配气候」一条"),G&&N(q("dt-hannuan"),"本盘偏热,寒暖一条正对")}d&&N(d,`本盘忌${o.foe}克用${o.use},局中${o.bridge}${o.weight}分可作通关,故取${P.ditian.name}「通关」一条`);const h=S.find(v=>v&&v.kind==="化气格"),y=S.find(v=>v&&v.kind==="组合"),x=A.monthBranch||A.frame&&A.frame.monthBranch||A.pillars&&A.pillars.month&&A.pillars.month.branch,M=["辰","未","戌","丑"].includes(x);return h?N(q("zp-bianhua"),`本盘列有「${h.name}」:用神由月令合化而变,总纲一位改取${P.ziping.name}论用神变化`):M?N(q("zp-zaji"),`月令${x}属四墓杂气,取用先看透干、再看会支,总纲一位取${P.ziping.name}论杂气如何取用`):y?N(q("zp-chengbai"),`本盘另有「${y.name}」组合:成格还要看带忌与救应,总纲一位改取${P.ziping.name}论用神成败救应`):N(q("zp-yongshen"),"用神从月令取、四吉顺用四凶逆用,是通用总纲"),c}function L(A){return!A||!A.length?"":A.map(s=>`《${P[s.book].name}·${s.chapter}》「${s.quote}」`).join(`
72
+ `)}return{CLASSIC_BOOKS:P,CLASSICS:B,classicOf:q,suiyunClassicOf:z,classicsFor:f,classicsText:L}})(),R.constitution=(function(){const{fail:P}=R.fail||{},B=5,F=[{key:"pinghe",name:"平和质",oneLine:"阴阳气血相对匀,吃得下、睡得着、恢复快。",trait:"精力够用,耐受冷热,情绪起伏不大,睡醒后能缓过来。",tendency:"这种底子最省心,重点是别自己把它折腾坏。",care:["食:什么都能吃一点,别追一个味道到底;七分饱比补品有用。","起居:睡点固定比睡够时长更关键,熬夜是最快的消耗方式。","动:每周三四次微汗即可,不必练到力竭。","情志:留一点「什么都不干」的时间,别把日程排满。"],questions:["你精力充沛,不太容易觉得累","你能耐受冷也能耐受热,换季不太难受","你胃口稳定,吃完不胀不反酸","你睡得踏实,醒来精神能回来","你情绪起伏不大,遇事能较快平复"]},{key:"qixu",name:"气虚质",oneLine:"气不够用:容易累、说话没劲、稍动就出汗。",trait:"容易疲乏、气短、说话声音低,活动后出汗多,容易感冒。",tendency:"不是懒,是电量掉得快;硬撑只会更空。",care:["食:主食别减太狠,山药、小米、黄豆这类平补的东西比猛补更合适。","起居:宁可早睡半小时,也别靠咖啡顶着;午间闭眼十分钟有用。","动:散步、八段锦这类「不喘」的运动优先,别一上来就高强度。","情志:少做长时间的强撑式社交,累了就直说。"],questions:["你容易疲乏,休息后也不太容易缓过来","你说话声音偏低,说久了觉得没气","你稍一活动就比别人容易出汗","你容易感冒,或者感冒后拖得久","你吃完饭容易腹胀、消化慢"]},{key:"yangxu",name:"阳虚质",oneLine:"火力不足:怕冷、手脚凉、喜欢热的。",trait:"畏寒怕冷、手脚发凉,吃凉的容易不舒服,大便偏稀,精神偏静。",tendency:"不是矫情,是产热不够;冷饮和空调直吹对这个体质最伤。",care:["食:热的、熟的优先;姜、羊肉、桂圆可以吃,但别一顿猛补。","起居:腰腹和脚要保暖,睡前泡脚比吃补药直接。","动:白天动起来产热,晒背十分钟比闷在屋里强。","情志:冬天与阴雨天情绪容易低,把户外时间挪到中午。"],questions:["你比一般人怕冷,别人不觉得冷时你已经要加衣服","你的手脚常年偏凉","你喝冷饮或吃凉的东西后容易不舒服","你大便偏稀,或者一受凉就腹泻","你精神偏静,不太想动"]},{key:"yinxu",name:"阴虚质",oneLine:"水不够:口干、手心热、睡不沉。",trait:"口燥咽干、手足心热、容易上火、睡浅多梦、大便偏干。",tendency:"不是火气大,是水少;越熬夜越明显。",care:["食:银耳、百合、梨、黑芝麻这类润的;辛辣烧烤少碰。","起居:熬夜对这个体质伤害最直接,十一点前躺下比什么方子都强。","动:别在正午暴晒下猛练,选傍晚、选温和的。","情志:容易急、容易烦,发现自己在赶时间就先停三分钟。"],questions:["你常觉得口干、咽干,想喝水","你手足心发热,或者下午容易烘热","你容易上火,口腔溃疡或脸上起东西","你睡得不沉,多梦,容易醒","你容易大便干结,排便不太顺畅"]},{key:"tanshi",name:"痰湿质",oneLine:"水湿停着走不动:身重、腹胀、容易困。",trait:"身体沉重、腹部松软肥满、容易困倦、口中黏腻、痰多。",tendency:"不是吃太多,是运化不动;久坐加甜腻会加重。",care:["食:少甜少油少夜宵;薏米、赤小豆、冬瓜这类利湿的可以常吃。","起居:别吃完就躺;房间保持干燥通风。","动:出汗是重点,快走、跳绳这类能真出汗的优先。","情志:困倦时容易拖,把要紧事放在上午做。"],questions:["你常觉得身体沉重、不清爽","你腹部松软,容易胀","你容易困倦,睡够了也昏沉","你口中黏腻,或者痰偏多","你脸上或头发容易出油"]},{key:"shire",name:"湿热质",oneLine:"又湿又热:脸油、口苦、容易长东西。",trait:"面垢油光、容易生痤疮、口苦口干、大便黏滞、小便偏黄。",tendency:"不是「火大」这么简单,湿裹着热,清得太猛反而伤脾。",care:["食:少酒少辣少油炸;绿豆、冬瓜、苦瓜可以吃,但别长期只吃寒凉。","起居:别熬夜加夜宵,这两样凑一起最容易出湿热。","动:规律出汗,运动后及时擦干换衣。","情志:急躁时先降一件事的优先级,别同时开五个头。"],questions:["你脸上或头皮容易出油","你容易长痘、长疖子或起湿疹","你常觉得口苦或口干","你大便黏滞,不容易冲干净","你的小便颜色偏黄、量偏少"]},{key:"xueyu",name:"血瘀质",oneLine:"血行不畅:肤色暗、易有瘀青、痛处固定。",trait:"面色偏暗、口唇偏紫、容易出现瘀斑、身体某处固定刺痛。",tendency:"久坐不动和长期受寒是两大来源。",care:["食:山楂、黑木耳、玫瑰花这类活血的可以常吃;经期量多时别过量。","起居:别久坐,每小时起来走两分钟。","动:有氧为主,练到微微出汗;拉伸比猛练更对症。","情志:闷着不说话最容易瘀,找个人把话说完。"],questions:["你面色或口唇偏暗、偏紫","你身上容易出现瘀青,磕一下就好久不退","你身体某处有固定的刺痛或胀痛","你皮肤偏干,或者容易起红血丝","你记性下降,或者常常觉得「脑子转不动」"]},{key:"qiyu",name:"气郁质",oneLine:"气堵着不顺:胸闷、爱叹气、情绪闷。",trait:"情绪低沉、容易紧张焦虑、胸闷叹气、咽部有异物感、睡不安稳。",tendency:"不是想太多,是气机不通;长期憋着会连带影响睡眠和胃口。",care:["食:少食多餐,别用吃东西压情绪;玫瑰花、陈皮、佛手可以泡水。","起居:把「必须做」的事减到三件以内,留出空档。","动:唱歌、快走、拉伸这类能「把气呼出去」的最有用。","情志:写下来比在脑子里绕有效,哪怕只写三行。"],questions:["你常觉得闷闷不乐,情绪提不起来","你容易紧张、焦虑,或者心里放不下事","你常叹气,觉得胸口不畅","你咽喉像有东西堵着,吞不下也吐不出","你睡不安稳,容易醒或者多梦"]},{key:"tebing",name:"特禀质",oneLine:"对外界刺激反应大:过敏、易起反应。",trait:"容易过敏(鼻炎、皮肤、食物)、对季节与气味敏感、易起荨麻疹。",tendency:"不是体质弱,是反应阈值低;避开诱因比「增强体质」更直接。",care:["食:把自己的过敏原记下来,比记一堆「该吃什么」有用。","起居:换季前把床品洗晒一遍,花粉季回家先洗脸。","动:室内温和运动为主,避开花粉浓度高的时段户外跑。","情志:反复发作容易烦,把「避免诱因」当成日常动作而不是任务。"],questions:["你容易打喷嚏、流清涕,或者鼻子痒","你皮肤容易起荨麻疹、湿疹或红疹","你对某些食物或药物有过敏反应","你对季节变化、气味或灰尘特别敏感","你换环境后容易不舒服(比如新房间、新城市)"]}],H=F.flatMap(m=>m.questions.map((f,L)=>({i:m.key+"-"+(L+1),key:m.key,name:m.name,text:f}))),D=[{v:1,label:"没有"},{v:2,label:"很少"},{v:3,label:"有时"},{v:4,label:"经常"},{v:5,label:"总是"}];function q(m,f){return Math.round((m-f)/(f*4)*1e3)/10}function z(m,f){return f?m>=60?"是":m>=50?"倾向是":"否":m>=40?"是":m>=30?"倾向是":"否"}function I(){return{system:"constitution",paper:!0,total:H.length,scaleCount:F.length,itemsPerScale:B,scale:D,scales:F.map(m=>({key:m.key,name:m.name,oneLine:m.oneLine,from:H.findIndex(f=>f.key===m.key)})),questions:H.map((m,f)=>({no:f+1,key:m.key,name:m.name,text:m.text})),howto:"按最近一年的真实感受给每题打 1–5 分(1 没有 / 2 很少 / 3 有时 / 4 经常 / 5 总是),拿不准的题传 null 跳过;把分数按题目顺序填成 answers 数组再调一次。",note:"九种体质各 5 题,共 45 题。这是按通行标准结构做的简化问卷,不是量表原件;结果只作自我观察的参照。"}}function k(m){const f=m&&Array.isArray(m.answers)?m.answers:null;if(!f)throw P("E_INPUT","体质判定需要 answers(按题目顺序的 1–5 分);先不带 answers 调一次拿问卷");const L=H.length;if(f.length!==L)throw P("E_INPUT",`answers 要 ${L} 个(九种体质各 5 题),收到 ${f.length} 个;跳过的题传 null,不要缩短数组`);const A=f.map((Q,me)=>{if(Q==null)return null;const $e=Number(Q);if(!Number.isInteger($e)||$e<1||$e>5)throw P("E_INPUT",`第 ${me+1} 题的分数要是 1–5 的整数或 null,收到「${String(Q).slice(0,16)}」`);return $e}),s=A.filter(Q=>Q!==null).length;if(!s)throw P("E_INPUT","answers 全为 null:至少答几题才能判体质,否则每种都是同一个分数");const c=F.map(Q=>{const me=[];H.forEach((b,Y)=>{b.key===Q.key&&me.push(Y)});const $e=me.map(b=>A[b]).filter(b=>b!==null),ze=me.reduce((b,Y)=>b+(A[Y]===null?3:A[Y]),0),i=q(ze,me.length);return{key:Q.key,name:Q.name,oneLine:Q.oneLine,trait:Q.trait,tendency:Q.tendency,care:Q.care.slice(),answered:$e.length,skipped:me.length-$e.length,raw:ze,max:me.length*5,converted:i,level:z(i,Q.key==="pinghe")}}),u=c.find(Q=>Q.key==="pinghe"),N=c.filter(Q=>Q.key!=="pinghe").slice().sort((Q,me)=>me.converted-Q.converted),S=N.map(Q=>Q.converted),$=S.length?Math.max(...S):0;let g=u.level;u.converted>=60&&($<30?g="是":$<40?g="基本是":g="否");const o={...u,level:g},d=N.find(Q=>Q.level==="是")||N[0],h=N.some(Q=>Q.level==="是"||Q.level==="倾向是"),y=g==="是"||g==="基本是",x=y&&!N.some(Q=>Q.level==="是")?o:d,M=N.find(Q=>Q.key!==x.key&&Q.converted>=30)||null,v=N.filter(Q=>Q.level==="是"&&Q.key!==x.key&&(!M||Q.key!==M.key)).map(Q=>Q.name),G=A.filter(Q=>Q!==null),se=G.length>=10&&new Set(G).size===1,C=x.key==="pinghe"?o:x;return{system:"constitution",meta:{answered:s,total:L,scaleCount:F.length,itemsPerScale:B,scale:D},scales:c.map(Q=>Q.key==="pinghe"?{...Q,level:g}:Q),primary:{key:C.key,name:C.name,converted:C.converted,level:C.level,oneLine:C.oneLine,trait:C.trait,tendency:C.tendency},secondary:M?{key:M.key,name:M.name,converted:M.converted,level:M.level}:null,mingled:v,pinghe:{converted:u.converted,level:g},balanced:y&&!N.some(Q=>Q.level==="是"),hasTendency:h,flat:se,care:C.care.slice(),top:N.slice(0,3).map(Q=>({name:Q.name,converted:Q.converted,level:Q.level})),note:"九种体质各 5 题的简化问卷,转化分按 [(原始分 − 题数) / (题数 × 4)] × 100 换算;偏颇质 ≥40 判「是」、30–39 判「有倾向」,平和质要 ≥60 且其余八种都低才成立。体质是长期倾向,不是当下病名;有具体不适请就医,这份结果不与八字、星座互证。"+(se?" 本次每题都选了同一个选项,问卷对你的区分度不足,主次体质仅供参考。":"")}}return{CONSTITUTIONS:F,QUESTIONS:H,SCALE_OPTIONS:D,constitutionPaper:I,buildConstitution:k}})(),R.followup=(function(){const{ZIWEI_STARS:P}=R["interpret-data"]||{},B=[{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:["出行","搬家","旅行","出国","迁","远行"]}],F={career:"官禄",wealth:"财帛",love:"夫妻",health:"疾厄",study:"官禄",travel:"迁移",overall:"命宫"},H=(u,N)=>{const S=String(u).match(/(20\d{2})\s*年?/);if(S)return Number(S[1]);const $=Array.isArray(N.liunian)&&N.liunian[0]?Number(N.liunian[0].year):null;return $?/明年/.test(u)?$+1:/后年/.test(u)?$+2:/去年/.test(u)?$-1:/今年|本年/.test(u)?$:null:null},D=u=>B.find(N=>N.words.some(S=>String(u).includes(S)))||null;function q(u,N){const S=H(N,u),$=D(N),g=Array.isArray(u.liunian)?u.liunian:[],o=Array.isArray(u.dayun?.list)?u.dayun.list:[],d=g.map(h=>h.year);if(S&&!g.some(h=>Number(h.year)===S))return{ok:!1,year:S,topic:$,answer:`这一盘已排的流年范围是 ${d[0]}–${d[d.length-1]},没有 ${S} 年。可以把问题改到范围内,或用 asOf 指定你想看的年份重新排盘。`,evidence:[`已排流年:${d.join("、")}`],confidence:"弱"};if(S){const h=g.find(se=>Number(se.year)===S),y=o.find(se=>Number(se.startAge)<=Number(h.age)&&Number(h.age)<=Number(se.startAge)+9)||null,x=h.luck?.tier||"平",M=(h.luck?.reasons||[]).slice(0,3),v=(h.relations||[]).join("、"),G=$?I(u,$.key):"";return{ok:!0,year:S,topic:$,answer:`${S} 年(${h.ganzhi})流年,十神为${h.stemTenGod||"—"},档位「${x}」;所行大运 ${y?`${y.ganzhi}(${y.luck?.tier||"平"})`:"未取到"}。${M.length?`理由:${M.join(",")}。`:""}${v?`与该年地支相关的原局关系:${v}。`:""}${G}`,evidence:[`流年 ${h.year} ${h.ganzhi}·${h.stemTenGod||""}·${x}`,y?`大运 ${y.ganzhi}·${y.luck?.tier||"平"}`:"",v?`原局关系 ${v}`:"",$?`问题方向:${$.label}`:""].filter(Boolean),confidence:y&&M.length?"强":"中"}}if($){const h={wealth:"overall",study:"work",travel:"overall"}[$.key]||$.key,y=(u.interpret?.dimensions||[]).find(M=>M.key===$.key||M.key===h);if(y){const M=u.frame&&u.frame.godStats&&u.frame.godStats.groups||{},v=$.key==="wealth"?` 财星权重 ${Number(M.财||0)}(只作结构参考,不含金额)。`:"";return{ok:!0,year:null,topic:$,answer:`按${$.label}这条线看:${y.text}${v}${y.advice?` 建议:${y.advice}`:""}`,evidence:(y.evidence||[]).slice(0,4),confidence:y.confidence||"中"}}const x=u.frame&&u.frame.godStats&&u.frame.godStats.groups||{};if(Object.keys(x).length){const M=["比劫","食伤","财","官杀","印"].map(v=>`${v} ${Number(x[v]||0)}`);return{ok:!0,year:null,topic:$,answer:`「${$.label}」这条线,这一盘只带了盘面结构:${M.join("、")}。具体吉凶与建议需要解析层(排盘时加 withInterpret),追问这里不自行推演。`,evidence:M.slice(0,3),confidence:"弱"}}}return{ok:!1,year:null,topic:$,answer:`这个问题里没有识别到具体的年份或方面。可以这样问:「2027 年事业怎么样」「财运如何」「感情在 2028 年」;已排流年是 ${d[0]}–${d[d.length-1]}。`,evidence:[`可问年份:${d.join("、")}`],confidence:"弱"}}function z(u,N){const S=H(N,u),$=D(N),g=Array.isArray(u.liunian)?u.liunian:[];if(S&&!g.some(o=>Number(o.year)===S))return{ok:!1,year:S,topic:$,answer:`这一盘的流年表覆盖 ${g[0]?.year}–${g[g.length-1]?.year},没有 ${S} 年;可以换一个年份,或用 asOf 指定起点重新排盘。`,evidence:[`流年表:${g.map(o=>o.year).join("、")}`],confidence:"弱"};if(S){const o=g.find(h=>Number(h.year)===S),d=o.daxian||{};return{ok:!0,year:S,topic:$,answer:`${S} 年(${o.ganzhi},${o.age} 岁)流年命宫落在「${o.lifePalace?o.lifePalace.palace:"—"}」,四化为 ${(o.mutagen||[]).join("、")||"不明显"};所行大限${d.palace?`在${d.palace}(${d.start}–${d.end} 岁)`:"未取到"}。${$?`与「${$.label}」对应的宫位信号见下条依据。`:""}`,evidence:[`流年命宫 ${o.lifePalace?o.lifePalace.palace:"—"}(${o.lifePalace?o.lifePalace.branch:"—"})`,`四化 ${(o.mutagen||[]).join("、")||"不明显"}`,d.palace?`大限 ${d.palace}·${d.start}–${d.end}岁`:""].filter(Boolean),confidence:(o.mutagen||[]).length>=3?"强":"中"}}if($){const o=F[$.key]||"命宫",d=(u.palaces||[]).find(h=>h.palace===o);if(d){const h=(d.stars||[]).filter(x=>x.type==="主星").map(x=>x.name),y=h.map(x=>P[x]?.trait).filter(Boolean).slice(0,2).join(";");return{ok:!0,year:null,topic:$,answer:`「${$.label}」看${o}:主星${h.length?h.join("、"):"无正曜(借对宫)"}${y?`——${y}`:""}。宫支${d.branch},${d.stems,""}生年四化与煞星的影响需结合报告里的对应分节一起看。`,evidence:[`${o} ${d.branch}·${h.join("、")||"无正曜"}`,...(d.shensha||[]).slice(0,3)],confidence:h.length?"强":"弱"}}}return{ok:!1,year:null,topic:$,answer:"没有识别到具体年份或方面。可以问「2028 年事业」「感情怎么样」「财运在 2030 年」;也可以直接问某个宫位,如「夫妻宫」。",evidence:[],confidence:"弱"}}function I(u,N){return`这段时间可以重点对照报告里「${{career:"事业",wealth:"财富",love:"感情",health:"健康",study:"学业",travel:"出行"}[N]||"整体"}」一节看。`}function k(u,N){const S=D(N),$=Array.isArray(u.interpret?.sections)?u.interpret.sections:[],g=S?$.find(h=>h.label.includes(S.label)||h.text.includes(S.label)):null;if(g)return{ok:!0,year:null,topic:S,answer:g.text,evidence:[`引用分节:${g.label}`],confidence:"中"};const o=$[0];if(o)return{ok:!1,year:null,topic:S,answer:`这一盘的追问需要落到具体方面(事业 / 财富 / 感情 / 健康 / 学业 / 出行)。先看「${o.label}」这一节,或把问题说得更具体一点。`,evidence:[],confidence:"弱"};const d=String(u&&u.summary||"").trim();if(d){const h=d.split(`
73
+ `).map(x=>x.trim()).filter(Boolean),y=S?h.filter(x=>S.words.some(M=>x.includes(M))):[];return{ok:!0,year:null,topic:S,answer:y.length?`${S.label}相关的盘面字段:${y.slice(0,3).join(";")}。这一盘没带解析层,只列盘面事实,不在这里补吉凶结论。`:`这一盘没有解析层,只能按盘面字段回答;可问的方向:${B.map(x=>x.label).join(" / ")}。下面任取摘要是盘面原文,未作推演。`,evidence:(y.length?y:h).slice(0,4),confidence:"弱"}}return{ok:!1,year:null,topic:S,answer:"这一盘暂时没有可追问的分节,也没有摘要字段;先重新排一次盘,再问具体方面。",evidence:[],confidence:"弱"}}function m(u,N){const S=String(N||"").trim(),$=u&&u.system==="bazi"?q(u,S):u&&u.system==="ziwei"?z(u,S):k(u,S);return{question:S,...$}}const f={bazi:"八字(四柱)",ziwei:"紫微斗数",liuyao:"六爻",meihua:"梅花易数",daliuren:"大六壬",qimen:"奇门遁甲",tarot:"塔罗",hepan:"合盘",chenggu:"称骨",almanac:"黄历",zeri:"择日",star:"星座",numerology:"生命数字",mbti:"十六型人格",trend:"人生 K 线",fengshui:"风水",name:"起名",convert:"公农历互转"},L=Object.freeze({bazi:["基本信息","四柱(日主/十神/藏干)","旺衰·格局·用神","合冲·神煞","起运·大运·流年","古籍依据"],ziwei:["基本信息","命宫/身宫与五行局","十二宫(主星/辅煞/四化)","格局与三方四正","大限/流年","古籍依据"],liuyao:["所问与用神","本卦/变卦(世应/动爻/六亲)","月建日辰(旺衰/空破)","应期线索","卦辞与依据"],meihua:["所问与体用","本卦/互卦/变卦","五行生克","应期与依据"],daliuren:["天地盘(月将/贵人)","四课","三传","课体与神将","依据"],qimen:["四柱与局数","九宫(星门神/天盘干)","用神落宫","门宫·干宫·十干克应","旺衰·击刑入墓","依据"],tarot:["问题与牌阵","逐牌(正逆/牌面/元素对应)","牌间关系","综合倾向","边界"],fengshui:["坐向与元运","运盘/山盘/向盘","旺山旺向","取象与边界"]}),A=Object.freeze(["基本信息","盘面事实","结构与关系","倾向","边界"]);function s(u){return L[u]||A}function c(u,N={}){const S=f[u&&u.system]||u&&u.system||"未知体系",g=String(N&&N.question||"").trim()||"请先用一句白话讲清这张盘的主线,再指出最值得注意的一两处,并说明每处的具体依据。",o=Number.isFinite(N&&N.maxChars)&&N.maxChars>=400?N.maxChars:3e3,d=String(u&&u.summary||"").trim(),h=d.length>o,y=h?`${d.slice(0,o)}…(摘要已截断)`:d,x=N&&typeof N.interpret=="object"&&N.interpret||u&&typeof u.interpret=="object"&&u.interpret||null,M=String(x&&x.answer||"").trim(),v=String(x&&x.plain||"").trim(),G=[];M&&G.push(`直答:${M}`),v&&G.push(`说人话:${v}`);const C=["【命理追问】下面这张盘是命理插件刚排好的,请就着它回答我的问题;不用重新排盘,盘面字段已经够用。",`体系:${S}`,`所问:${g}`,"",...G.length?["——开场结论(插件已按同一套规则算好,开场先沿用这句;措辞可改,口径别换)——",...G,""]:[],"——盘面层次(从上到下读,别跳层)——",`${S}:${s(u&&u.system).join(" → ")}`,"先复述事实,再讲结构与时间;上一层没交代清楚,不要跳到下一层。","","——盘面摘要——",y||"(这张盘没有摘要字段,请先让我重新排一次。)",...String(u&&u.jing||"").trim()?["","——《周易》经文原文(本插件按三份底本互校照录,〔一作…〕是异文,不是改写)——",String(u.jing).trim()]:[],...u&&u.zuoyao&&u.zuoyao.verses?["",`——紫微杂曜安星诀(本盘开了全表,${u.zuoyao.placed.length} 颗已按下列诀安入;诀文出多处近代通行辑本并核,属通行说,不是《紫微斗数全书》原文)——`,String(u.zuoyao.verses).trim(),`未另立:${(u.zuoyao.skipped||[]).join(";")}`]:[],"","——回答要求——","读者不懂命理。按下面的骨架答;任何一句他看不懂,就算没写完:",G.length?"1) 开头一句结论:先沿用上面的「开场结论」,再用一句不用术语的话说清这张盘的主线——只读这一句也该有收获;":"1) 开头一句结论:不用术语,一句话说清这张盘的主线,只读这一句也该有收获;","2) 第二段只复述盘面骨架:按上面的层次用 2–4 行写事实(如四柱、格局、用神、大运),不掺倾向,让读者知道后面的判断从哪来;","3) 判断最多两条,按重要性排序,每条分四行写:"," 盘面|只引盘面已有的字(具体的柱、宫或爻、字段名),不掺解释;"," 白话|把上一行的术语当场翻成日常话——调候 / 化气 / 通关 / 空亡 / 争合 这类词必须落地,一个词只翻一次,不连续堆三个以上;"," 倾向|说「更可能……」,讲清它在现实里大概意味着什么,用概率语气;"," 边界|这条在什么情况下不成立;盘面没给的,直接写「这盘里看不出来」;","4) 收尾一句「如果只记一件事」:给一条能核对、能动手的观察点,并说明它出自上面哪条盘面依据;","5) 别把传统说法当成已证实的事实:不下绝对断言,也不用「肯定」「绝对」这类词,更不写「格局很好」「运程不顺」这种没有信息的空话。"].join(`
74
+ `);return{text:C,question:g,system:u&&u.system||"",label:S,chars:C.length,truncated:h}}return{followup:m,READING_ORDERS:L,READING_ORDER_FALLBACK:A,readingOrderOf:s,askPrompt:c}})(),R.revise=(function(){const P=[{key:"ziwei",label:"紫微",re:/紫微|斗数/},{key:"bazi",label:"八字",re:/八字|四柱/},{key:"liuyao",label:"六爻",re:/六爻|摇卦/},{key:"qimen",label:"奇门",re:/奇门/},{key:"daliuren",label:"大六壬",re:/大六壬|六壬/},{key:"tarot",label:"塔罗",re:/塔罗|抽牌/},{key:"meihua",label:"梅花",re:/梅花/},{key:"hepan",label:"合盘",re:/合盘|合婚/},{key:"almanac",label:"黄历",re:/黄历|老黄历/},{key:"zeri",label:"择日",re:/择日|挑日子/},{key:"fengshui",label:"风水",re:/风水/},{key:"name",label:"起名",re:/起名|取名/},{key:"chenggu",label:"称骨",re:/称骨/},{key:"xiaoliuren",label:"小六壬",re:/小六壬/},{key:"star",label:"星座",re:/星座/},{key:"numerology",label:"生命数字",re:/生命数字|生命灵数/},{key:"mbti",label:"MBTI",re:/mbti|人格测试|十六型/i},{key:"trend",label:"人生 K 线",re:/k\s*线|人生曲线/i},{key:"convert",label:"公农历互转",re:/农历转公历|公历转农历|公农历/}],B=[{key:"love",label:"感情",re:/感情|婚姻|恋爱|对象|夫妻/},{key:"wealth",label:"财运",re:/财运|财富|赚钱|收入|破财/},{key:"career",label:"事业",re:/事业|工作|升职|跳槽/},{key:"health",label:"健康",re:/健康|身体|疾病|病/},{key:"study",label:"学业",re:/学业|考试|考研|升学|读书/},{key:"travel",label:"出行",re:/出行|搬家|迁移|旅行|外地/}],F=/换成|改成|改为|换到|改看|再看|再看一下|换一套|排一?张|用|按|看/,H=k=>String(k||"").replace(/(出生|出生地|所在地|人)$/,"").replace(/[的了].*$/,"").trim();function D(k){const m=String(k??"").trim(),f={},L=[],A=[];if(!m)return{text:"",patch:f,labels:L,ignored:A};if(F.test(m)){for(const u of P)if(u.re.test(m)){f.system=u.key,L.push({key:"system",label:"体系",value:u.key,display:u.label});break}}/女命|女性|换成女|改成女|女盘/.test(m)?(f.gender="female",L.push({key:"gender",label:"性别",value:"female",display:"女"})):/男命|男性|换成男|改成男|男盘/.test(m)&&(f.gender="male",L.push({key:"gender",label:"性别",value:"male",display:"男"})),/晚子时/.test(m)&&(/不换日|不换天|算当日|归当日|按当日|当天/.test(m)?(f.lateZi=!1,L.push({key:"lateZi",label:"晚子时",value:!1,display:"23:00 后仍算当日"})):/换日|算次日|归次日|按次日|第二天|次日/.test(m)&&(f.lateZi=!0,L.push({key:"lateZi",label:"晚子时",value:!0,display:"23:00 后算次日"}))),/真太阳时/.test(m)&&(/不用|不要|关闭|关掉|取消|不算/.test(m)?(f.trueSolar=!1,L.push({key:"trueSolar",label:"真太阳时",value:!1,display:"用东八区平太阳时"})):(f.trueSolar=!0,L.push({key:"trueSolar",label:"真太阳时",value:!0,display:"按出生地经度校正"}))),/夏令时/.test(m)&&(/不用|不要|关闭|关掉|取消|不校正/.test(m)?(f.dst=!1,L.push({key:"dst",label:"夏令时",value:!1,display:"不自动校正 1986–1991 夏令时"})):(f.dst=!0,L.push({key:"dst",label:"夏令时",value:!0,display:"自动校正 1986–1991 夏令时"})));const s=m.match(/出生在\s*([\u4e00-\u9fa5]{2,12})/)||m.match(/出生地(?:改成|改为|换成|换到|是|为)?\s*([\u4e00-\u9fa5]{2,12})/)||m.match(/改到\s*([\u4e00-\u9fa5]{2,12})\s*出生/);if(s){const u=H(s[1]);u.length>=2&&(f.address=u,L.push({key:"address",label:"出生地",value:u,display:u}))}const c=m.match(/(?:看|查|问|到|到了|临近)\s*((?:19|20)\d{2})\s*年/)||m.match(/((?:19|20)\d{2})\s*年(?:的)?(?:运势|怎么样|如何|会怎样|流年)/);if(c){const u=Number(c[1]);f.asOf=`${u}-01-01T00:00`,L.push({key:"asOf",label:"流年基准",value:f.asOf,display:`${u} 年`})}else/(出生|生年)/.test(m)&&/(19|20)\d{2}\s*年/.test(m)&&A.push("出生年份没改:一句话改不出日与时辰,请直接传 datetime(如 1993-04-08T06:20)");for(const u of B)if(u.re.test(m)){f.direction=u.key,L.push({key:"direction",label:"询问方向",value:u.key,display:u.label});break}return/解读|详解|详细说|说人话/.test(m)&&!/不要解读|不用解读|别解读/.test(m)&&(f.withInterpret=!0,L.push({key:"withInterpret",label:"解读",value:!0,display:"附解析与详解"})),{text:m,patch:f,labels:L,ignored:A}}const q=P,z=B;function I(k,m){if(m==null)return null;if(k==="system"){const f=P.find(L=>L.key===m);return f?f.label:String(m)}if(k==="gender")return m==="female"?"女":m==="male"?"男":String(m);if(k==="direction"){const f=B.find(L=>L.key===m);return f?f.label:String(m)}if(typeof m=="boolean")return m?"开":"关";if(k==="asOf"){const f=String(m).match(/^(\d{4})/);return f?`${f[1]} 年`:String(m)}return String(m)}return{parseRevision:D,REVISE_SYSTEMS:q,REVISE_DIRECTIONS:z,displayValue:I}})(),R.handle=(function(){const{fail:P}=R.fail||{},B="mc1.",F=new Set(["handle","trace","shadow","shadowVersion","diff","withInterpret","detail","cross","verifyPast","rectify","events","ask","followup","question","geocode","caliber","geo","longitudeFromGeo","revise"]),H=d=>d!==null&&typeof d=="object"&&!Array.isArray(d);function D(d){if(Array.isArray(d))return`[${d.map(y=>D(y===void 0?null:y)).join(",")}]`;if(H(d))return`{${Object.keys(d).filter(x=>d[x]!==void 0).sort().map(x=>`${JSON.stringify(x)}:${D(d[x])}`).join(",")}}`;const h=JSON.stringify(d===void 0?null:d);return h===void 0?"null":h}function q(d){let h=2166136261;for(let y=0;y<d.length;y++)h^=d.charCodeAt(y),h=Math.imul(h,16777619)>>>0;return h.toString(16).padStart(8,"0")}const z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function I(d){const h=[];for(const y of String(d)){let x=y.codePointAt(0);x<128?h.push(x):x<2048?h.push(192|x>>6,128|x&63):x<65536?h.push(224|x>>12,128|x>>6&63,128|x&63):h.push(240|x>>18,128|x>>12&63,128|x>>6&63,128|x&63)}return h}function k(d){let h="";for(let y=0;y<d.length;){const x=d[y];let M,v;x<128?(M=x,v=1):x<224?(M=x&31,v=2):x<240?(M=x&15,v=3):(M=x&7,v=4);for(let G=1;G<v;G++)M=M<<6|d[y+G]&63;y+=v,h+=String.fromCodePoint(M)}return h}function m(d){const h=I(d);let y="";for(let x=0;x<h.length;x+=3){const M=h[x],v=h[x+1],G=h[x+2];if(y+=z[M>>2],y+=z[(M&3)<<4|(v===void 0?0:v)>>4],v===void 0||(y+=z[(v&15)<<2|(G===void 0?0:G)>>6],G===void 0))break;y+=z[G&63]}return y}function f(d){const h=[];let y=0,x=0;for(const M of d){const v=z.indexOf(M);if(v<0)throw new Error(`不是 base64url 字符:${M}`);y=y<<6|v,x+=6,x>=8&&(x-=8,h.push(y>>x&255))}return k(h)}function L(d={}){const h={};for(const[y,x]of Object.entries(d||{}))F.has(y)||x===void 0||(h[y]=x);return h}function A(d={}){const h=L(d);if(!Object.keys(h).length)return"";const y=m(D(h));return`${B}${y}.${q(y)}`}function s(d){if(typeof d!="string"||!d.trim())throw P("E_HANDLE","handle 必须是非空字符串;没拿到句柄时照常传 system + datetime 等原始参数即可");const h=d.trim();if(!h.startsWith(B))throw P("E_HANDLE",`handle 前缀不对(应以 ${B} 开头):句柄来自旧版本或复制不全,重新排一次盘取新的 handle`);const y=h.slice(B.length),x=y.lastIndexOf(".");if(x<=0)throw P("E_HANDLE","handle 缺少校验位:复制时可能被截断,重新取一次");const M=y.slice(0,x),v=y.slice(x+1);if(q(M)!==v)throw P("E_HANDLE","handle 校验不通过:内容被改动或截断,重新排一次盘取新的 handle");let G;try{G=JSON.parse(f(M))}catch{throw P("E_HANDLE","handle 内容无法解析(不是本插件生成的句柄),重新排一次盘取新的 handle")}if(!H(G))throw P("E_HANDLE","handle 内容不是参数对象,重新排一次盘取新的 handle");return G}const c=new Set(["__proto__","constructor","prototype"]),u={hour:["chenggu","xiaoliuren","name"],minute:["name"],date:["xiaoliuren"],mode:["convert","meihua","xiaoliuren"],action:["fengshui","name"]};function N(d,h){if(!H(d))return d;const y=d.system;if(typeof y!="string"||!y)return d;for(const[x,M]of Object.entries(u))h.has(x)||d[x]===void 0||M.includes(y)||delete d[x];return d}function S(...d){const h=new Set;for(const y of d)if(H(y))for(const[x,M]of Object.entries(y))M!==void 0&&x!=="handle"&&h.add(x);return h}function $(d={}){if(!H(d))return d;const{handle:h,...y}=d;if(h==null||h==="")return{...y};const M={...s(h)};for(const[v,G]of Object.entries(y))G===void 0||c.has(v)||(M[v]=G);return N(M,S(y)),M}return{handlePayload:L,encodeHandle:A,decodeHandle:s,pruneForeignKeys:N,ownedKeys:S,resolveHandle:$,HANDLE_PREFIX:B,handleChecksum:q}})(),R.bridge=(function(){const{encodeHandle:P,decodeHandle:B,HANDLE_PREFIX:F}=R.handle||{},{askPrompt:H}=R.followup||{},D=200,q=60,z={bazi:"八字",ziwei:"紫微",liuyao:"六爻",meihua:"梅花",daliuren:"大六壬",qimen:"奇门",hepan:"合盘",tarot:"塔罗",almanac:"黄历",zeri:"择日",chenggu:"称骨",xiaoliuren:"小六壬",star:"星座",numerology:"生命数字",mbti:"人格",trend:"人生K线",fengshui:"风水",name:"起名",convert:"农历",constitution:"体质",wuyunliuqi:"运气",taiyi:"太乙"},I=$=>z[$]||$||"未知体系";function k($){const g=String($||""),o=g.indexOf("#");return o<0?g:g.slice(0,o)}function m($){try{return encodeURIComponent($)}catch{return""}}function f($){try{return decodeURIComponent($)}catch{return String($||"")}}function L($={},g={}){const o=g||{},h=String(o.handle||$&&$.handle||"").trim()||P($||{});if(!h||!h.startsWith(F))return"";const y=String(o.question||"").trim().slice(0,D),x=[`mp=${h}`];return y&&x.push(`q=${m(y)}`),`${k(o.base)}#${x.join("&")}`}function A($){const g=String($||"").trim();if(!g)return{ok:!1,code:"E_LINK",message:"没有链接内容:请粘贴带 #mp= 的完整链接"};let o="";const d=g.indexOf("#");if(d>=0&&g.slice(d+1).trim())o=g.slice(d+1).trim();else{const M=g.indexOf("?");M>=0&&g.slice(M+1).trim()?o=g.slice(M+1).trim():/^mp=/.test(g)&&(o=g)}if(!o)return{ok:!1,code:"E_LINK",message:"链接里没有 #mp= 片段:这不是本插件生成的深链"};const h={};for(const M of o.split("&")){if(!M)continue;const v=M.indexOf("=");if(v<=0)continue;const G=M.slice(0,v),se=M.slice(v+1);G==="mp"?h.mp=se:G==="q"&&(h.q=se)}if(!h.mp)return{ok:!1,code:"E_LINK",message:"链接里没有 mp 参数(只有问题没有盘):无法还原盘面"};let y;try{y=B(h.mp)}catch(M){return{ok:!1,code:M&&M.code||"E_HANDLE",message:M&&M.message||"句柄无法解析"}}const x=h.q?f(h.q).slice(0,D):"";return{ok:!0,handle:h.mp,args:y,question:x,system:y.system||"",label:I(y.system)}}const s=$=>{const g=/^(\d{4}-\d{1,2}-\d{1,2})[T ](\d{1,2}:\d{2})/.exec(String($||"").trim());if(!g)return{date:"",time:""};const[o,d,h]=g[1].split("-");return{date:`${o}-${String(d).padStart(2,"0")}-${String(h).padStart(2,"0")}`,time:g[2].padStart(5,"0")}},c=["gender","address","trueSolar","lateZi","lines"];function u($){const g=$&&$.ok?$:null,o=g&&g.args||{},d=s(o.datetime),h={tab:o.system||"",date:d.date,time:d.time,question:g&&g.question||"",restored:[],rest:{}};h.tab&&h.restored.push("system"),d.date&&h.restored.push("datetime");for(const y of c)o[y]===void 0||o[y]===null||(h[y]=o[y],h.restored.push(y));h.question&&h.restored.push("question");for(const[y,x]of Object.entries(o))y==="system"||y==="datetime"||c.includes(y)||(h.rest[y]=x);return h}function N($){const g=Object.keys($&&$.rest||{});return g.length?`链接里还有 ${g.length} 项没填回表单(${g.join("、")}):这些只在引擎调用里生效,页面上按默认值显示。`:""}function S($,g={}){const o=g||{},d=$||{},h=d.system||"",y=I(h),x=String(o.question||"").trim(),M=String(d.handle||"").trim();let v="";try{const $e=H(d,{question:x,interpret:o.interpret});v=$e&&$e.text||String(d.summary||"")}catch{v=String(d.summary||"")}const G=x?x.length>q?`${x.slice(0,q)}…`:x:"(未填问题:按摘要讲主线)",se=M?`【命理追问】${y}|${M}|问:${G}`:`【命理追问】${y}|问:${G}`,C={};M&&(C.handle=M),h&&(C.system=h),x&&(C.question=x);const Q=JSON.stringify({tool:"metaphysics",v:1,args:C},null,2),me=M?L({handle:M},{question:x,base:o.base}):"";return{system:h,label:y,handle:M,question:x,full:v,brief:se,structured:Q,link:me}}return{LINK_MAX_QUESTION:D,askLink:L,parseAskLink:A,formOf:u,restNote:N,askPackages:S}})(),R["plain-summary"]=(function(){const{ASK_KINDS:P}=R["event-prompt"]||{},{PALACE_FIELD:B,GATE_MEANING:F}=R["qimen-prompt"]||{},H=P||{},D=B||{},q=F||{},z={wealth:"business",career:"career",love:"love",health:"other",study:"career",travel:"action",general:"other"},I=i=>z[i]||(H[i]?i:"other"),k={木:{color:"青、绿",where:"东边、有树有水的地方",daily:"早上多出门走走"},火:{color:"红、橙、紫",where:"南边、向阳的房间",daily:"白天多晒太阳,别总待在阴冷的屋里"},土:{color:"黄、棕、米色",where:"中原地带、干爽高燥处",daily:"把作息和吃饭时间固定下来"},金:{color:"白、银、浅灰",where:"西边、通风利落的地方",daily:"把该断的事断干净,别拖"},水:{color:"黑、深蓝",where:"北边、临水处",daily:"留出独处和放空的时间"}},m={正印:"靠吸收和消化来获得安全感,习惯先想明白再动",偏印:"想得比说得多,一件事会在心里推演出很多种可能",正官:"对规矩和责任敏感,别人一句交代会变成自己的压力",七杀:"对压力和竞争敏感,遇强则强,也容易被强势的人吸引",正财:"对现实条件敏感,不太会被空话打动",偏财:"对机会敏感,愿意为看得见的回报承担风险",食神:"表达温和,喜欢把日子过得有滋味",伤官:"有自己的标准,看不上粗糙的东西,容易先挑毛病",比肩:"自我边界清楚,不太愿意被安排",劫财:"同辈之间容易较劲,也容易替朋友出头"},f={长生:"刚起步,有生机",沐浴:"不安定,容易被外界牵动",冠带:"在成形,开始要面子",临官:"正当力,能扛事",帝旺:"很足,但也容易过满",衰:"开始收力,做事偏保守",病:"使不上劲,需要借外力",死:"静态,不爱主动",墓:"收着、藏着,不爱外露",绝:"在这里使不上劲,容易觉得被压着",胎:"还在孕育,慢热",养:"在积攒,等时机"},L={紫微:"要主导、在意体面",天机:"脑子转得快,爱盘算",太阳:"愿意给出去,也容易被消耗",武曲:"务实,认结果",天同:"图安稳,怕冲突",廉贞:"要强,情绪起伏大",天府:"稳,能存住东西",太阴:"细腻,心思藏在里面",贪狼:"欲望强、多才多艺",巨门:"爱辨析,也容易生口舌",天相:"会配合,擅长讲和",天梁:"老成,愿意护着别人",七杀:"独断,敢冲",破军:"破旧立新,不安于现状"},A={庙:"得力",旺:"得力",得地:"还算得力",平:"一般",陷:"不太稳"},s=i=>[...new Set(i.filter(Boolean))],c={寅:"初春",卯:"仲春",辰:"暮春",巳:"初夏",午:"盛夏",未:"长夏",申:"初秋",酉:"仲秋",戌:"深秋",亥:"初冬",子:"仲冬",丑:"隆冬"};function u(i,b){const Y={po:[],chong:[],he:[]};for(const K of i&&i.branches||[])!b||!String(K).includes(b)||(/破/.test(K)?Y.po.push(K):/冲/.test(K)?Y.chong.push(K):/合/.test(K)&&Y.he.push(K));return Y}function N(i){const b=i.pillars||{},Y=b.day||{},K=b.month||{},j=i.dayMaster||{},E=i.climate||{},_=i.input&&i.input.gender||"female",J=Object.entries(i.frame&&i.frame.godStats&&i.frame.godStats.groups||{}).filter(([,he])=>he>0).sort((he,Te)=>Te[1]-he[1]),V=i.frame&&i.frame.yongshen&&i.frame.yongshen.favorTenGods||[],oe=i.frame&&i.frame.yongshen&&i.frame.yongshen.favor||[],ie=i.frame&&i.frame.yongshen&&i.frame.yongshen.avoid||[],ue=c[K.branch]||`${K.branch}月`,U=E.label==="寒湿"?"天寒水旺,木像冬天的藤,不是不强,是冷得伸展不开":E.label==="燥热"?"火土偏燥,像久旱的地,需要水和湿气来松一松":"寒暖相对均衡,没有极端的偏枯",ce=E.need&&E.need.element||oe[0]||"",le=i.frame&&i.frame.caiKu||null,be=le?le.present?le.opened&&le.verdict==="开库主发"?`财有库(${le.store}),而且库门被${le.opener}冲开了:钱是能进来的,关键在于你肯不肯把它存住。`:le.opened&&le.verdict==="开库反主破财"?`财有库(${le.store})也被冲开了,但这一行在你这盘上是忌:动得越多漏得越快,稳比冲重要。`:le.opened?`财有库(${le.store}),库门也开了,但财本身不算厚:有得有失,别指望一次翻身。`:`财有库(${le.store}),门还关着:不是没有,是要等对的时间或对的选择把它引出来。`:"财这一路没有立库,赚多少看明面上的财星与行运,不靠「开库」这一说。":"",Ne=`${j.stem||""}${j.element||""}日主,生在${ue}${K.branch||""}月:${U}。${ce?`最需要的是${ce}${E.need&&E.need.why?`——${E.need.why}`:""}。`:""}整体${i.strength?i.strength.level:"中和"},不是极旺也不是极弱,所以${i.strength&&i.strength.level==="身弱"?"很多事要靠外部条件配合,硬扛不如借力":"撑得住,关键是别把力气用在错的地方"}。`+be,te=J.slice(0,2).map(([he])=>he),ye=[];for(const he of Object.values(b))he&&(he.stemTenGod&&ye.push(he.stemTenGod),he.hidden&&he.hidden[0]&&he.hidden[0].tenGod&&ye.push(he.hidden[0].tenGod));const Ze=`${te.map(he=>{const Te={印:["正印","偏印"],官杀:["正官","七杀"],食伤:["食神","伤官"],财:["正财","偏财"],比劫:["比肩","劫财"]}[he]||[],_e=Te.find(Re=>ye.includes(Re))||Te[0];return _e&&m[_e]?`${he}偏重:${m[_e]}。`:""}).filter(Boolean).join("")}${V.length,""}`+(te.includes("印")?"想得多是你的默认状态,好处是稳,代价是慢和累。":""),Je=_==="female"?["正官","七杀"]:["正财","偏财"],De=_==="female"?"官杀(正官与七杀)":"财星(正财与偏财)",Ye={year:"年干",month:"月干",day:"日干",hour:"时干"},Ie=Object.entries(b).filter(([,he])=>he&&Je.includes(he.stemTenGod)).map(([he,Te])=>`${Ye[he]}${Te.stemTenGod}`),Pe=Y.hidden&&Y.hidden[0]&&Y.hidden[0].tenGod||"",Ae=u(i.relations,Y.branch),Ee=[];Ee.push(`${_==="female"?"女命":"男命"}看配偶星取${De}${Ie.length?`,${Ie.join("、")}`:",盘中未透干"}${Ie.length?"——摆在明处,说明这件事在你生活里是绕不开的主题":"——不显在明处,往往要靠后天遇到的人把它带出来"}。`),Pe&&Ee.push(`日支(配偶宫)坐${Y.branch}${Pe}${Y.dishi?`,日主在这里是「${Y.dishi}」:${f[Y.dishi]||""}`:""}。`),Ae.po.length&&Ee.push(`日支与另一支相破(${Ae.po.join("、")}):破不是吵架,是那种说不清、解释不明白的暗耗,容易冷处理。`),Ae.chong.length&&Ee.push(`日支逢冲(${Ae.chong.join("、")}):关系里变动感强,聚散、异地、节奏不一致都可能出现。`),Ae.he.length&&Ee.push(`日支有合(${Ae.he.join("、")}):容易被关系拴住,进去了就不太想出来。`),i.hourUnknown&&Ee.push("时柱暂缺,所以「子女」这一路的信息读不出,感情结论也就少了三分之一。");const Ce=(i.frame&&i.frame.geju||[]).map(he=>he.name),ve=[];Ae.po.length&&ve.push("破在日支:最伤人的往往不是大事,是没说开的小事。"),Ce.includes("伤官见官")&&ve.push("盘里有「伤官见官」的组合:既想要稳定,又忍不了对方的毛病,这是同一件事的两面。"),te.includes("印")&&!te.includes("财")&&ve.push("印重而财轻:想得多、落得少;越焦虑越容易继续想。"),ve.length||ve.push("这一盘没有特别尖锐的冲克,卡点更多在「节奏」上——什么时候该动,什么时候该停。");const Oe=[];if(ce&&k[ce]){const he=k[ce];Oe.push(`多接触${ce}:${he.color}这类颜色、${he.where},日常可以${he.daily}。`)}ie.length&&Oe.push(`少把自己放在${ie.slice(0,2).join("、")}过重的环境里——不是不能碰,是别长期待在那种氛围中。`),te.includes("印")&&Oe.push("给「想」设个时限:一件事想超过十分钟还没结论,就先做一个最小动作,用行动换信息。"),Ce.includes("伤官见官")&&Oe.push("把标准用在事情上,不要用在人身上;对人提要求之前,先说清你需要什么。");const we=i.frame&&i.frame.balance||null;if(we){const he=[];we.wuxing.ok||he.push(`五行偏在${we.wuxing.highest}、缺在${we.wuxing.lowest}`),we.yinyang.ok||he.push(we.yinyang.pure?`${we.yinyang.pure}之局`:`阴阳一边倒(阳 ${we.yinyang.yang}/阴 ${we.yinyang.yin})`),we.climate.ok||he.push(`寒暖燥湿没调匀(${we.climate.kind})`),Oe.push(he.length?`结构上${he.join("、")}:不必去「补命」,把这几处当作长期要照看的方向就行。`:"五行、阴阳、寒暖燥湿三方面都还匀:这种盘最忌讳的是为了「更好」而硬改节奏,稳住就是优势。")}return{system:"bazi",title:"先看这一张:这张盘大致在说什么",chips:s([`${j.stem||""}${j.element||""}日主`,`${K.branch||""}月`,E.label||"",i.strength?i.strength.level:"",i.hourUnknown?"时柱暂缺":""]),lead:Ne,sections:[{h:"你的底色",t:Ze||"结构比较均衡,没有一边倒的偏重。"},{h:"感情这件事",t:Ee.join("")},{h:"最容易卡住的地方",t:ve.join("")}],advice:Oe,caveat:i.hourUnknown?"时柱暂缺:以上只据年、月、日六个字,等于全盘信息的七成左右。子女缘分、晚年走势、以及「内心最深处那一层」都读不全,结论只作参考。":"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}function S(i){const b=i.palaces||[],Y=b[0]||{},K=i.body||{},j=(Y.stars||[]).filter(te=>te.type==="主星"),E=b.find(te=>te.isBody)||{},_=b.find(te=>te.palace==="夫妻")||{},J=j.map(te=>te.name).join("、")||"空宫(借对宫)",V=j.map(te=>A[te.brightness]||"").filter(Boolean)[0]||"",oe=te=>te.filter(ye=>ye.type==="主星").map(ye=>`${ye.name}${L[ye.name]?`(${L[ye.name]})`:""}`).join(";"),ie=i.patternSummary||{},ue=s(ie.broken||[]),U=s(ie.bad||[]),ce=s([...ie.good||[],...ie.neutral||[]]).filter(te=>!ue.includes(te)),le=_.stars||[],be=le.filter(te=>te.type==="主星"),Ne=le.filter(te=>te.type==="煞星");return{system:"ziwei",title:"先看这一张:这张盘大致在说什么",chips:s([`命宫在${Y.branch||""}`,J,i.bureau?i.bureau.name:"",K.lands?`身宫落${K.lands}`:""]),lead:`命宫在${Y.branch||""},坐${J}${V?`(${V})`:""};身宫落在${K.lands||K.palace||"—"}。${j.length?`底色是${j.map(te=>L[te.name]||te.name).join("、")}。`:"命宫无主星,性格更多由对宫与三方决定,可塑性反而大。"}${ce.length?`结构上成的是${ce.slice(0,3).join("、")}——格局只说明形状,不是吉凶判词。`:"没有完整成套的格局,这一盘更多看单颗星的性质,少看组合。"}`,sections:[{h:"你的底色",t:`${oe(Y.stars||[])||"命宫无主星,靠三方四正补"}。身宫落${K.lands||"—"},说明你这辈子真正花力气的地方在${K.lands||"那一块"}。`},{h:"感情这件事",t:`夫妻宫在${_.branch||"—"},坐${be.map(te=>`${te.name}${te.brightness?`(${A[te.brightness]||te.brightness})`:""}`).join("、")||"空宫(借对宫)"}。${Ne.length?`同宫还有${Ne.map(te=>te.name).join("、")}——关系里容易起摩擦,来得快也去得快。`:"没有明显的煞星同宫,关系相对平顺。"}`},{h:"最容易卡住的地方",t:`${ue.length?`被冲破的格局有${ue.join("、")}——结构还在,但成色打折;冲不等于毁,说的是它不如完好时那么顶用。`:"主要格局没有明显被冲破。"}${U.length?`另有${U.join("、")}这类忌格,只描述结构,不作吉凶断。`:""}`}],advice:[`命宫主星${j.length?`是${j.map(te=>te.name).join("、")},顺它的长处在做事,比硬改性格省力`:"不显,先靠环境和习惯替自己定节奏"}。`,`身宫落${K.lands||"—"}:这块是你真正在意的地方,也是容易耗人的地方,留出余量。`],caveat:"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}const $={旺:"当令,气最足",相:"有生机,正在起",休:"气在泄,歇着",囚:"被压着,使不上劲",死:"最弱,得靠外援"},g={官鬼:"职位、压力、管你的人和事",妻财:"钱、资源、实际回报",父母:"文书、答复、流程与长辈",子孙:"结果本身、松弛、把事情落地",兄弟:"同辈、分利、竞争"},o={日生:"日辰生它,当天有人托着",日克:"日辰克它,当天被压一头",比和:"与日辰同气,力量相当",日合:"与日辰相合,黏住了",日冲:"与日辰相冲,当天就动"};function d(i){if(!i)return"";const b=[],Y=$[i.monthState]||i.monthSay||"";Y&&b.push(`月令${i.monthState||""}(${Y})`);const K=o[i.dayRelation]||i.daySay||"";return K&&b.push(K),i.kong&&b.push("旬空——抓不实,等冲或填"),i.moving&&b.push("发动,是这件事的动因"),i.monthChong&&b.push("月破,先破后立"),b.join(";")}function h(i){const b=i.hexStrength&&i.hexStrength.lines||[];if(!b.length)return null;const Y=b.find(ce=>ce.shi)||null,K=b.find(ce=>ce.ying)||null,j=i.body||{},E=j.ben||{},_=j.bian||{},J=i.cast&&i.cast.movingPositions||[],V=b.filter(ce=>ce.moving),oe=String(i.question||"").trim(),ie=s([...j.labels||[],...i.hexStrength&&i.hexStrength.labels||[]]),ue=i.hexStrength&&i.hexStrength.month?i.hexStrength.month.branch:"",U=[E.chong?"六冲卦:事情容易散、节奏快":"",E.he?"六合卦:事情黏住、快不起来":"",j.fuYin&&(j.fuYin.inner||j.fuYin.outer)?"有伏吟:原地打转":"",j.fanYin&&(j.fanYin.inner||j.fanYin.outer)?"有反吟:来回反复":""].filter(Boolean);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([E.name,_.name?`变${_.name}`:"",J.length?`${J.length} 爻动`:"静卦",ue?`${ue}月`:""]),lead:`${oe?`你问的是「${oe}」。`:""}本卦「${E.name||"—"}」${_.name?`,${J.length?`第 ${J.join("、")} 爻动`:"六爻安静"},变「${_.name}」`:""}。方向还留在「综合」,所以这一卦没有取用神——先只讲与问题无关的那几样:你(世爻)、事情(应爻)、卦体。`,sections:[{h:"代表你的是",t:Y?`世爻在${Y.name}(${Y.branch}${Y.element}·${Y.liuqin}):${d(Y)||"状态平稳"}。`:"这一卦取不到世爻。"},{h:"代表事情的是",t:K?`应爻在${K.name}(${K.branch}${K.element}·${K.liuqin}):${d(K)||"状态平稳"}。应爻说的是「事情那一头」的状态,不是你努力的程度。`:"这一卦取不到应爻。"},{h:"卦体与动爻",t:`${U.length?`${U.join(";")}。`:"没有六冲、六合、伏吟、反吟这类整体结构。"}${V.length?`动爻在${V.map(ce=>`${ce.name}(${ce.liuqin})`).join("、")}——动的地方,就是这件事会发生变化的那一环。`:"六爻安静:眼下没有明显在动的地方,说明事情的节奏还没起来。"}`}],advice:["先在上面选一个「询问方向」(工作、感情、生意、推进、择日):选完才会取用神,旺衰、应期、成败条件才有落点。",...(H.other&&H.other.reality||[]).slice(0,2)].filter(Boolean),caveat:"未指定所问之事:这一版只读世应、卦体与动爻,不判成败,也不给应期——不是算不出来,是取用神要先知道问什么。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function y(i){const b=i.useGod||{};if(!b.liuqin)return h(i);const Y=b.found||[];if(!Y.length&&!b.missing)return null;const K=String(i.question||"").trim(),j=i.useGodStrength&&i.useGodStrength.lines||[],E=te=>j.find(ye=>ye.position===te)||null,J=(i.hexStrength&&i.hexStrength.lines||[]).find(te=>te.shi)||null,V=i.useGodStrength&&i.useGodStrength.month?i.useGodStrength.month.branch:"",oe=i.dayGanZhi&&i.dayGanZhi.name||"",ie=Y.map(te=>te.name).join("、"),ue=`${K?`你问的是「${K}」。`:"你没填具体问题,这里按「综合」取用神,结论会更粗。"}这卦里代表它的是「${b.liuqin}」(${b.ask||""}),`+(Y.length?`落在${ie}${Y.length>1?"——两处都出现了,两个条件要一起看":""}。`:"盘中看不见它(伏藏),要等冲开或引出才有动静。")+`日辰是${oe||"—"},月建是${V||"—"}。`,U=[],ce=[];for(const te of Y){const ye=E(te.position);ye&&(/旺|相/.test(ye.monthState||"")&&!ye.kong&&!ye.monthChong&&U.push(te.name),(/日克|日冲/.test(ye.dayRelation||"")||ye.kong||ye.monthChong)&&ce.push(te.name))}const le=Y.length?U.length>ce.length?"条件偏有利":ce.length>U.length?"条件偏紧,得有外力或时间":"一半一半,取决于你怎么推":"没有可判的落点",be=s([...(b.labels||[]).filter(te=>/两现|伏藏|六合|六冲/.test(te)),i.body&&i.body.ben&&i.body.ben.chong?"六冲卦:事情容易散,节奏偏快":"",i.body&&i.body.ben&&i.body.ben.he?"六合卦:事情黏住,快不起来":""]),Ne=s((i.yingqi&&i.yingqi.items||[]).map(te=>te.branch)).slice(0,4);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([i.ben&&i.ben.name,`用神 ${b.liuqin||""}`,V?`${V}月`:"",i.yingqi?i.yingqi.tempo:""]),lead:ue,sections:[{h:"代表你的是",t:J?`世爻在${J.name}(${J.branch}${J.element}·${J.liuqin}):${d(J)||"状态平稳"}。`:"这一卦的世爻取不到,先看用神那一条。"},{h:"代表这件事的是",t:Y.length?Y.map(te=>`${te.name} ${te.ganzhi}(${te.liuqin}):${d(E(te.position))||"没有明显的月日冲克"}。`).join(""):"用神伏藏:盘中看不见它,说明这件事现在还不在明面上,要等一个引子。"},{h:"成不成看哪里",t:`把用神的月令与日辰放在一起,盘面给的是「${le}」。${be.length?`另有:${be.join(";")}。`:""}`}],advice:[...(H[I(b.direction)]&&H[I(b.direction)].reality||[]).slice(0,2),Ne.length?`应期只看地支:${Ne.join("、")}——地支只是「往哪个方向等」,不是公历日期。`:""].filter(Boolean),caveat:s([Y.length>1?`用神两现(${ie}):本插件不替你二选一,两处条件一起看。`:"",b.missing?"用神伏藏:先看伏神与飞神的关系,再看有没有东西把它冲出来。":"","世应只说明「你」和「事」的相对位置,不直接等于吉凶。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function x(i){const b=i.bodyUse;if(!b||!b.body||!b.use)return null;const Y=String(i.question||"").trim();return{system:"meihua",title:"先看这一卦:方向大致在哪",chips:s([i.ben&&i.ben.name,i.bian&&`变${i.bian.name}`,b.relation?`体用 ${b.relation.split("(")[0]}`:""]),lead:`${Y?`你问的是「${Y}」。`:""}本卦「${i.ben&&i.ben.name}」,动在第 ${i.moving} 爻,变卦「${i.bian&&i.bian.name}」。体卦 ${b.body.trigram}(${b.body.element})代表你,用卦 ${b.use.trigram}(${b.use.element})代表这件事:${b.relation}。`,sections:[{h:"过程与结果",t:`过程看互卦「${i.hu&&i.hu.name||"—"}」,结果看变卦「${i.bian&&i.bian.name||"—"}」。梅花给的是方向,不是细节——它不会告诉你几号、多少钱。`},{h:"盘面给的分量",t:`这一卦的体用关系被标成「${b.level}」。注意:这是条件层面的判断,不是结果已经发生;条件好但不动,一样没有结果。`}],advice:["把它当「换个角度看这件事」:体用只分「谁在给、谁在耗」,剩下要你自己补具体动作。","如果要推进,先定一个最小动作(打个电话、发条消息),别等条件齐了再动。"],caveat:"梅花取象的自由度大:同一卦,不同人读出的细节可以不同。本插件只取体用生克这一层。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function M(i){const b=i.sanChuan||{};if(!b.chu||!b.zhong||!b.mo)return null;const Y=String(i.question||"").trim(),K=E=>`${E.zhi}(${E.liuQin||""}·${E.jiangFull||""})`,j=E=>g[E.liuQin]?`——${g[E.liuQin]}`:"";return{system:"daliuren",title:"先看这一课:事情怎么走到这一步",chips:s([i.geJu&&i.geJu.name,`${b.chu.zhi}→${b.mo.zhi}`,i.yueJiang&&`月将${i.yueJiang.zhi}`]),lead:`${Y?`你问的是「${Y}」。`:""}三传是 ${b.chu.zhi} → ${b.zhong.zhi} → ${b.mo.zhi};末传落 ${b.mo.zhi}(${b.mo.liuQin||""}·${b.mo.jiangFull||""}),课体是「${i.geJu&&i.geJu.name||"—"}」。`,sections:[{h:"起手(初传)",t:`${K(b.chu)}${j(b.chu)}。这是事情开头的样子。`},{h:"转折(中传)",t:`${K(b.zhong)}${j(b.zhong)}。中间会经过这一段,也是容易改道的地方。`},{h:"落点(末传)",t:`${K(b.mo)}${j(b.mo)}。末传比初传更接近结果——但也只是「照现在这样走下去会到哪」。`}],advice:["先看初传:事情是从哪儿起的?把那个起点找出来,比猜结果有用。","中传若与初传相冲相克,说明中途会变;这时别把计划定死。"],caveat:"三传讲的是传变形态,不给具体日期;同一课不同流派对课体的命名也有差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function v(i){const b=i.siZhu&&i.siZhu.day?String(i.siZhu.day)[0]:"",Y=i.siZhu&&i.siZhu.time?String(i.siZhu.time)[0]:"",K=i.palaces||[];if(!K.length)return null;const j=U=>K.find(ce=>ce.tianPan===U)||(i.centerPalace&&i.centerPalace.tianPan===U?i.centerPalace:null),E=j(b),_=j(Y),J=String(i.question||"").trim(),V=U=>{const ce=U&&D[U.palace]&&D[U.palace].field;return ce?ce.split(":")[0]:U?`${U.palace}宫`:"盘中取不到"},oe=U=>U&&D[U.palace]&&D[U.palace].dir?`(${D[U.palace].dir})`:"",ie=U=>U?`${V(U)}${oe(U)}|${U.gate||"—"}·${U.star||"—"}·${U.god||"—"}`:"盘中取不到",ue=U=>!U||!U.gateRelation||!U.gateRelation.type?"门与宫的关系没算到":`${U.gateRelation.type}(${U.gateRelation.note||""})`;return{system:"qimen",title:"先看这一局:条件和位置在哪",chips:s([i.ju,i.zhiFu&&`值符${i.zhiFu.star}`]),lead:`${J?`你问的是「${J}」。`:""}日干 ${b} 落在${ie(E)},时干 ${Y} 落在${ie(_)}——前者代表你,后者代表这件事。你这边门与宫是${ue(E)};事情那边是${ue(_)}。`,sections:[{h:"你这边的条件",t:E?`你在${D[E.palace]?D[E.palace].field:E.palace+"宫"};门是${E.gate||"—"}——${q[E.gate]||"门名只说明形态"}。`:"日干落在中宫或取不到:中宫无门无神,按寄宫(多寄坤二)取用,读的时候要说清这是寄宫。"},{h:"事情那边的条件",t:_?`事情落在${D[_.palace]?D[_.palace].field:_.palace+"宫"};门是${_.gate||"—"}——${q[_.gate]||"门名只说明形态"}。`:"时干落在中宫或取不到,同样按寄宫看,别当成坤二本宫。"},{h:"门名不是吉凶",t:"开门主启动、生门主生长、休门主等待、伤门主损耗、杜门主隐藏——这些说的是「这件事现在是什么形态」,不是好坏判决。要看它与日干宫、时干宫的生克。"}],advice:["把「我这边」和「事情那边」的宫位对一下:两边相距越远,越需要中间人、流程或时间。","如果门名是伤门、死门,不是叫你别做,而是提醒这件事的代价和收尾要先想清楚。"],caveat:s([i.juMethodNote||"","奇门重方位与时机;本插件不给具体方位建议,只把宫位与门星神摊开。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function G(i){const b=i.cards||[];if(!b.length)return null;const Y=String(i.question||"").trim(),K=b.find(j=>/现在|现况|当下|建议|核心/.test(j.position||""))||b[Math.floor(b.length/2)];return{system:"tarot",title:"先看这几张牌:它们各在说什么",chips:s([i.spread]),lead:`${Y?`你问的是「${Y}」。`:""}${i.spread||""}:`+b.map(j=>`${j.position}「${j.name}」${j.orientation}`).join(",")+"。",sections:b.slice(0,4).map(j=>({h:j.position,t:`「${j.name}」${j.orientation}:${(j.keywords||[]).slice(0,3).join("、")||j.core||""}。${j.image?`牌面上${j.image}。`:""}${j.astro?`占星对应是${j.astro}。`:j.role?`它在盘上顶的是「${j.role}」那个角色。`:""}${j.positionHint||""}`})),advice:[`最值得先看的是「${K.name}」(${K.position}·${K.orientation})——${(K.keywords||[]).slice(0,3).join("、")||"它所在的位置,就是这件事现在的着力点"}。`,"把牌当镜子:它给的是看事情的角度,不是判决。看完写一句「那我下一步做什么」。"],caveat:i.systemNote||"塔罗为象征系统,牌义与元素对应存在流派差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function se(i){const b=i.score;if(!b)return null;const Y=(i.dimensions||[]).filter(_=>_&&_.text),K=_=>{const J=_&&_.dayMaster;return J?typeof J=="string"?J.replace(/日主$/,""):`${J.stem||""}${J.element||""}`:""},j=K(i.a),E=K(i.b);return{system:"hepan",title:"先看这一张:你们大致怎么相处",chips:s([j&&E?`${j} × ${E}`:"",b.level,`${b.total}/100`]),lead:`${j&&E?`你们是 ${j} 与 ${E}。`:""}合盘描述的是「相处方式与互补点」,不判合不合,也不决定关系成败。整体上盘面给的是「${b.level}」(${b.total}/100——分数只是相对刻度,不是及格线)。`,sections:Y.slice(0,3).map(_=>({h:_.label,t:_.text})),advice:["一起看,别一个人看完拿去判断对方:前者是对话,后者是审判。","把上面的分歧当话题清单:哪一条你们真的在意,就聊哪一条。"],caveat:i.notes&&i.notes[0]||"合盘看的是相处方式与互补点,不决定关系成败。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function C(i){const b=i.points||[],Y=i.segments||[];if(!b.length||!Y.length)return null;const K=Number.isInteger(i.meta&&i.meta.nowYear)?i.meta.nowYear:null,j=K&&b.find(le=>le.year===K)||null,E=j&&Y.find(le=>j.age>=le.startAge&&j.age<=le.endAge)||Y[0],_=Y[Y.indexOf(E)+1],J=b.filter(le=>le.age>=E.startAge&&le.age<=E.endAge),V=J.length?J.reduce((le,be)=>le+be.score,0)/J.length:0,oe=b.reduce((le,be)=>le+be.score,0)/b.length,ie=V>=oe+5?"比一生平均更亮":V<=oe-5?"比一生平均更闷":"与一生平均差不多",ue=i.highlights&&i.highlights.best||[],U=i.highlights&&i.highlights.worst||[],ce=j?`你现在 ${j.age} 岁(${K} 年),在「${E.ganZhi}」这一步的第 ${j.age-E.startAge+1} 年(${E.startAge}–${E.endAge} 岁)${_?`,再过 ${E.endAge-j.age+1} 年到 ${_.startAge} 岁换「${_.ganZhi}」`:",已是最后一步"}。`:`没给当前日期(asOf),所以不标「现在在第几步」;先看第一步「${E.ganZhi}」(${E.startAge}–${E.endAge} 岁)起手的样子。`;return{system:"trend",title:"先看这一条线:这些年大致什么走势",chips:s([E.ganZhi,`${E.startAge}–${E.endAge} 岁`,j?`${j.age} 岁`:""]),lead:`这条线按 ${i.meta&&i.meta.toAge||b.length} 岁排到 ${b[b.length-1].year} 年,共 ${Y.length} 步大运。`+ce,sections:[{h:"这一步的基调",t:`这一步里各年的平均分是 ${V.toFixed(0)},${ie}(全盘平均 ${oe.toFixed(0)})。分数是相对刻度,不是绝对值。`},{h:"这些年里最亮和最闷的",t:`${ue.length?`高点:${ue.slice(0,2).join("、")}`:"没有特别高的点"};${U.length?`低点:${U.slice(0,2).join("、")}`:"没有特别低的点"}。高点适合推进,低点适合收口。`},{h:"怎么用这条线",t:"它不是命运表,是把「顺/不顺」画成可视的起伏。真正决定走向的,是你在这几步里做了什么。"}],advice:["把下一步换运的年龄记下来:换运前后半年,通常是最容易做决定、也最容易冲动的时候。","低点年别做大额投入,高点年别只观望——这两条比记分数管用。"],caveat:"线按年岁等距绘制,实际每步大运十年;起点与交运按节气推算,出生时刻未知时按日估算。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function Q(i){const b=i.taiyi,Y=[{h:"太乙落在哪一宫",t:`${b.palaceName}宫(${b.dir}),这是三年里的第 ${b.yearInPalace} 年,对应「${b.li}」。太乙三年换一宫,走的是八宫、不入中五,所以在盘面上永远看不到它落在中间。`},{h:"八门这三十年",t:`${i.gate.gate}。八门三十年一转,1954 年从休门起,顺序是休、生、伤、杜、景、死、惊、开,所以一个门要值三十年,不是每年都换。`},{h:"文昌在哪",t:`文昌在${i.wenchang.pos}(${i.wenchang.god},${i.wenchang.palaceName}宫)。文昌十八年一周,阳局从申起、阴局从寅起,路上遇乾、坤各数两次,所以要数满十八步才回到原点。`},{h:"计神、始击与主客算",t:`计神在${i.jishen.branch},始击在${i.shiji.pos}(${i.shiji.god})。主算 ${i.suan.zhu}、客算 ${i.suan.ke}:大将按算数的个位落宫(整十归一),参将是大将乘三的个位。四个将分别落在${i.jiang.zhuDaName}、${i.jiang.keDaName}、${i.jiang.zhuCanName}、${i.jiang.keCanName}宫。`},{h:"定目、三基与五福",t:`定目在${i.dingmu.pos}(${i.dingmu.god}):淘金歌讲「以合神加太岁」,把合神搬到太岁处,天目跟着转过去,落点就是定目。三基——君基${i.sanji.jun}(三十年一移)、臣基${i.sanji.chen}(三年一移)、民基${i.sanji.min}(一年一移);五福在${i.wufu.palaceName}宫(四十五年一移),大游在${i.dayou.palaceName}宫(三十六年一移、逆数)。十精另五位:天乙${i.shijing.tianyi}、地乙${i.shijing.diyi}、直符${i.shijing.zhifu}、四神${i.shijing.sishen}、小游${i.shijing.xiaoyou}。`},{h:"阴阳数和",t:`主算:${i.heshu.zhu.text}客算:${i.heshu.ke.text}这一段只说「和不和」,上和、次和、下和是算数落在特定数上的分级,不据此断胜负。`},{h:"卦象吉凶",t:`${i.jixiong.label}。${i.jixiong.text}${i.jixiong.note}判据出自卷一《推太公考时法》,只标吉凶,不推成与不成。`},{h:"神将与判辞",t:(()=>{const K=i.shenjiang;if(!K||!K.rows)return"这一盘没有排神将。";const j=K.goods&&K.goods.length?"在吉神下的:"+K.goods.join("、"):"没有将落在吉神下",E=K.bads&&K.bads.length?"在凶神下的:"+K.bads.join("、"):"没有将落在凶神下",_=i.verdict?"合起来判「"+i.verdict.label+"」。":"";return"按日干起十二神("+K.stem+"日、"+(K.day?"昼贵":"夜贵")+"、贵人临"+K.startBranch+(K.dir>0?"顺":"逆")+"行),"+j+";"+E+"。"+_+"这一层是古人拿十二神看四将落位的办法,只说明古法怎么判,不是对事情的预测。"})()},{h:"这一盘算到哪一层",t:`积年 ${i.meta.jinian},残年 ${i.meta.rest360},${i.meta.dunText}${i.meta.ju}局。太乙、八门、文昌、计神、始击、主客算与四将、掩迫囚格关、定目、三基、五福、大游、十精、阴阳数和、月日时三计、古法吉凶都在;${i.scope.notCovered.join("、")}这几项没有收录,盘面上也不显示。`}];return{system:"taiyi",title:"先看这一张",chips:[`${i.meta.year}年`,`${i.meta.dunText}${i.meta.ju}局`,`${b.palaceName}宫`].filter(Boolean),lead:`${i.meta.year} 年太乙:${i.meta.dunText}${i.meta.ju}局,太乙临 ${b.palaceName} 宫(${b.dir}),八门值 ${i.gate.gate}。`,sections:Y,advice:[`先看太乙落在哪:${b.palaceName}宫${b.dir},这三年的大方向就在这一格,别拿它当每年的细节来读。`,`八门十年一变的说法常被混用,这里按三十年一转的口径——${i.gate.gate}值这三十年,不是今年才轮到。`,"太乙是象数盘,给的是位置的对应关系,不是「今年会发生什么」的判决。"],caveat:`这一层到太乙、八门、文昌、计神、始击、主客算与四将、八种格局、定目、三基、五福、大游、十精与阴阳数和;${i.scope.notCovered.join(";")}都未收录,别按它们解读。`,footer:"太乙年家用积年推局,与八字按立春换年、运气按大寒分年都不同口径,三套不要互相印证。"}}function me(i){const b=[];i.special.taiYi&&b.push("太乙天符"),i.special.tianFu&&!i.special.taiYi&&b.push("天符"),i.special.suiHui&&!i.special.taiYi&&b.push("岁会"),i.special.tongTianFu&&b.push("同天符"),i.special.tongSuiHui&&b.push("同岁会");const Y=[{h:"这一年的气候底色",t:i.combo.text},{h:"此刻在哪个运、哪口气",t:i.current.text},{h:"被强调的脏腑",t:`中运主${i.zhongyun.organ}:传统上这样描述——${i.zhongyun.effect.organ}。${i.zhongyun.effect.sign}`},{h:"今年常被说到的身体反应",t:`上半年(${i.sitian.qi}司天):${i.sitian.climate.sign};下半年(${i.zaiquan.qi}在泉):${i.zaiquan.climate.sign}`}];return{system:"wuyunliuqi",title:"先看这一张",chips:[`${i.year.ganzhi}年`,i.zhongyun.name,`${i.sitian.qi}司天`].filter(Boolean),lead:`${i.year.ganzhi} 运气年:中运${i.zhongyun.name},${i.sitian.qi}司天、${i.zaiquan.qi}在泉。`,sections:Y,advice:[`顺着「${i.zhongyun.nature}」来调:${i.zhongyun.tai?"本气偏胜,别再加码,先把被克的那一头护住":"本气不足,别硬扛,先补本气再谈其他"}。`,`这一年偏「${i.sitian.climate.climate}」,起居上按这个方向做减法,比按季节硬套更贴。`,"运气盘给的是「今年偏什么」,不是「你会得什么病」;有具体不适看医生。"],caveat:b.length?`特殊格局:${b.join("、")}。${i.special.notes.join("")}`:"这一年在格局上没有天符、岁会那一类标记,按中运与司天在泉的常例读就好。",footer:"运气年以大寒为界,与八字按立春定年柱不同;两套口径不要互相印证。"}}function $e(i){const b=i.primary,Y=[];b&&(Y.push({h:b.name+"是什么",t:(b.oneLine||"")+(b.trait?" "+b.trait:"")}),b.tendency&&Y.push({h:"容易被影响的地方",t:b.tendency}));const K=(i.top||[]).find(j=>b&&j.name!==b.name);return K&&Y.push({h:"次高的一项",t:`${K.name} ${K.converted} 分(${K.level})——它常和主质一起出现,调的时候顺手带上。`}),{system:"constitution",title:"先看这一张",chips:[b?b.name:"未判定",i.pinghe?`平和 ${i.pinghe.converted}`:"",i.meta?`${i.meta.answered}/${i.meta.total} 题`:""].filter(Boolean),lead:b?`主体质是「${b.name}」${b.level==="是"?"":`(${b.level},未完全达判定线)`},转化分 ${b.converted};平和质 ${i.pinghe?i.pinghe.converted:"—"} 分。`:"这份问卷还没答够,先别急着对号入座。",sections:Y,advice:(i.care||[]).slice(0,3),caveat:i.flat?"每题都选了同一个选项,问卷对你的区分度不足——主质仅供参考,建议按最近一年的真实感受重答一遍。":"体质是长期倾向,不是病名,也不与八字、星座互证;有具体不适请就医。",footer:"打分为自评,同一个人隔一个月再答可能差一档,看趋势比看单次结果有用。"}}function ze(i){return!i||typeof i!="object"?null:i.system==="bazi"?N(i):i.system==="ziwei"?S(i):i.system==="liuyao"?y(i):i.system==="meihua"?x(i):i.system==="daliuren"?M(i):i.system==="qimen"?v(i):i.system==="tarot"?G(i):i.system==="hepan"?se(i):i.system==="trend"?C(i):i.system==="constitution"?$e(i):i.system==="wuyunliuqi"?me(i):i.system==="taiyi"?Q(i):null}return{plainSummary:ze}})(),R.index=(function(){const{buildBazi:P}=R.bazi||{},{buildLiuyao:B,tossLines:F,bodyLabels:H,yongshenOf:D,yongshenStrength:q,fushenAccess:z,hexagramStrength:I,jinTuiPower:k,yingqiWindow:m}=R.liuyao||{},{buildZiwei:f,BRIGHTNESS:L,flowOf:A,asOfParts:s,ZIWEI_SCHOOL_DEFAULTS:c}=R.ziwei||{},{drawTarot:u,SPREAD_KEYS:N}=R.tarot||{},{buildMeihua:S}=R.meihua||{},{buildDaliuren:$}=R.daliuren||{},{buildHepan:g,tripleOf:o}=R.hepan||{},{buildZiweiHepan:d}=R["ziwei-hepan"]||{},{buildQimen:h,buildSnapshot:y}=R.qimen||{},{geocodeAddress:x,resolveAddress:M}=R.geo||{},{toJDN:v,ganzhiName:G,dayGanzhiIndex:se}=R.calendar||{},{bool:C,canonicalFlags:Q,canonicalNumbers:me}=R.bool||{},{randomOf:$e,isSeed:ze}=R.random||{},{encodeHandle:i,decodeHandle:b,resolveHandle:Y,pruneForeignKeys:K,ownedKeys:j}=R.handle||{},{askLink:E,parseAskLink:_,formOf:J,restNote:V,askPackages:oe}=R.bridge||{},{parseRevision:ie,displayValue:ue}=R.revise||{},{interpret:U,DIRECTIONS:ce,DIRECTION_DEFAULT:le}=R.interpret||{},{followup:be,askPrompt:Ne}=R.followup||{},{crossCheck:te,crossText:ye,crossSection:Ke}=R.crosscheck||{},{pastSignals:Ze,verifyFit:Je}=R.verify||{},{rectifyBirth:De}=R.rectify||{},{buildAlmanac:Ye}=R.almanac||{},{buildZeri:Ie}=R.zeri||{},{buildChenggu:Pe}=R.chenggu||{},{buildXiaoliuren:Ae}=R.xiaoliuren||{},{buildStar:Ee}=R.star||{},{buildNumerology:Ce}=R.numerology||{},{buildMbti:ve,mbtiPaper:Oe}=R.mbti||{},{buildConstitution:we,constitutionPaper:he}=R.constitution||{},{buildWuyunliuqi:Te}=R.wuyunliuqi||{},{buildTaiyi:_e}=R.taiyi||{},{buildConvert:Re}=R.convert||{},{classicsFor:zn,classicsText:Nn,suiyunClassicOf:tn,classicOf:an,CLASSIC_BOOKS:Ge}=R.classics||{},{diffObjects:on,summarize:sn,sortDiffs:rn,labelOf:un,rootOf:ln,categoryOf:cn,formatValue:Ue,CALIBER_SWITCHES:An,viewRows:En}=R.diff||{},{canonicalJson:qt,fingerprintOf:Tn}=R.fingerprint||{},{buildTrend:hn}=R.trend||{},{buildFengshui:He}=R.fengshui||{},{buildName:dn}=R.name||{},{buildTrace:mn,traceMarkdown:fn,SYSTEM_LABEL:vn}=R.trace||{},{fail:re}=R.fail||{},{assertCivil:It,MIN_YEAR:$n,MAX_YEAR:yn}=R.validate||{},{parseDateTime:fe,daysInMonth:On}=R.datetime||{},_t=e=>String(e).padStart(2,"0"),Mn=["male","female"],qn=new Set(["bazi","ziwei","hepan","trend","meihua","daliuren","qimen","name"]),In={bazi:{what:"时柱",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(只排三柱)"},ziwei:{what:"命宫与生时星曜",advice:"紫微排不出三柱,必须补上出生时刻"},hepan:{what:"两侧时柱",advice:"两侧都要出生时刻,合盘才有意义"},trend:{what:"时柱与起运",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(按日估算)"},meihua:{what:"起卦时刻",advice:"时间起卦要用真实起念时刻,请补 HH:mm"},daliuren:{what:"起课时辰(月将与贵人)",advice:"请补起课时刻 HH:mm"},qimen:{what:"起局时辰(旬首与局数)",advice:"请补起局时刻 HH:mm"},name:{what:"时柱",advice:"请补出生时刻 HH:mm"}};function Me(e,t=""){if(Mn.includes(e))return e;const a=e==null||e===""?"(未提供)":`「${e}」`;throw re("E_INPUT",`${t?t+"的":""}gender 必须是 male 或 female${a};性别决定大运/大限顺逆,不能靠默认值`)}const _n=["brightnessSchool","gengYearSihua","tianmaSchool","tiankongSchool","jiekongSchool","kuiyueSchool","tianshiTianshang","changshengSchool","lateZishi","shenzhuSchool","mingzhuSchool","zuoyaoSchool","liunianSihua","sihuaVariant","jieluSchool","suipoSchool"];function pn(e){const t={};for(const a of _n)e[a]!==void 0&&(t[a]=e[a]);return e.schools&&typeof e.schools=="object"&&(t.schools=e.schools),t}function Ln(e){const t=e.pillars,a=(ae,ge)=>`${ae}:${ge.ganzhi} ${ge.stemTenGod?`十神 ${ge.stemTenGod} `:""}藏干 ${ge.hidden.map(qe=>`${qe.stem}(${qe.tenGod})`).join(" ")} 纳音 ${ge.nayin} 地势 ${ge.dishi} 自坐 ${ge.zizuo} 空亡 ${ge.kongwang.join("")}`+(ge.shensha&&ge.shensha.length?` 神煞 ${ge.shensha.join("、")}`:""),n=Object.entries(e.wuxing).map(([ae,ge])=>`${ae}${ge}`).join(" "),l=e.palaces?`【胎元】${e.palaces.taiyuan.ganzhi} 胎息 ${e.palaces.taixi?e.palaces.taixi.ganzhi:"—"}`+(e.palaces.minggong?` 命宫 ${e.palaces.minggong.ganzhi}`:" 命宫 时柱暂缺,不排")+(e.palaces.shengong?` 身宫 ${e.palaces.shengong.ganzhi}`:" 身宫 时柱暂缺,不排"):"",r=e.dayun.list.slice(0,8).map(ae=>`${ae.startAge}岁 ${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}${ae.relations&&ae.relations.length?`[${ae.relations.join("")}]`:""}`).join(" "),p=e.dayun.jiao&&e.dayun.jiao.at?`;交运 ${e.dayun.jiao.at}(${e.dayun.jiao.frame},距${e.dayun.jiao.from.name} ${e.dayun.jiao.spanDays} 天,三日折一年)`:"",w=e.dayun.startAgeExact,T=w&&Number.isInteger(w.years)?`起运岁(精确):${w.years} 年 ${w.months} 个月 ${w.days} 天 ${w.hours} 小时(${w.caliber};上面「${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月」是四舍五入到月,两者同源)`:"",ee=e.jieqi.nearBoundaryMinutes<20?`
75
+ ⚠ 出生时刻距「节」仅 ${e.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`:"",W={year:"年",month:"月",day:"日",hour:"时"},Z=e.shensha&&e.shensha.groups&&e.shensha.groups.length?`神煞(${e.shensha.count} 见):`+e.shensha.groups.map(ae=>`${ae.cat}|`+ae.items.map(ge=>`${ge.name}(${ge.pillars.map(qe=>W[qe]).join("")})`).join("、")).join(";"):"神煞:—",O=e.renyuan,ne=an("smt-renyuan"),X=O?`人元:${O.month}月第${O.day}日,${O.active}${O.activeElement}司权(${O.segments.map(ae=>`${ae.stem}${ae.from}–${ae.to}`).join(" ")})${O.beyond?";已过 30 日表,按本气算":""}${ne?`|原文见《${Ge[ne.book].name}·${ne.chapter}》`:""}`:"",pe=e.frame&&e.frame.yongshen&&e.frame.yongshen.disputed||[],de=pe.length?` 有争议:${pe.map(ae=>`${ae.element}(${ae.favorRole};${ae.climate}盘调候忌${ae.element})`).join("、")}`:"",je=new Set(pe.map(ae=>ae.element)),Se=e.frame&&e.frame.yongshen&&e.frame.yongshen.neutral||[],Nt=Se.length?` 中性偏忌:${Se.map(ae=>`${ae.element} ${ae.weight} 分`).join("、")}(近零,不作实忌)`:"",At=e.frame?[`格局:${e.frame.primary?`${e.frame.primary.name}(${e.frame.primary.evidence})`:"—"}`,`   ${e.frame.geju.map(ae=>`${ae.name}[${ae.kind}${ae.status?`·${ae.status}`:""}]`).join(" ")}`,`用神:喜${e.frame.yongshen.favor.join("")}(${e.frame.yongshen.favorTenGods.join("、")}) 忌${e.frame.yongshen.avoid.join("")}(${e.frame.yongshen.avoidTenGods.join("、")})${de}${Nt} ${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}${je.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(([ae,ge])=>`${ae}${ge}`).join(" ")}`]:[],ke=e.strength&&e.strength.branchStructure,Et=ke?ke.branches.map(ae=>`${ae.label}${ae.branch}${ae.camp}${ke.placeholderHour&&ae.key==="hour"?"·占位":""}`).join("、"):"",Tt=ke&&!ke.placeholderHour&&!ke.complete?" 时柱暂缺,只列三支":"",xn=ke?`地支结构:${ke.placeholderHour?"三支+占位":"四支"} ${ke.code}(${Et}) ${ke.word}${ke.congProb!=null?`(静态从格 ${ke.congRange})`:""}${Tt}`:"",Fe=e.relations&&Array.isArray(e.relations.anhe)?e.relations.anhe:[],kn=Fe.length?`暗合:${Fe.join(" ")}(另列,不并入上面的合冲刑害;${Fe.length===1?"只一对,按口径可忽略":`共 ${Fe.length} 对`})`:"",vt=e.hourUnknown===!0||!t.hour;return[`【四柱】${t.year.ganzhi} ${t.month.ganzhi} ${t.day.ganzhi}${t.hour?` ${t.hour.ganzhi}`:"(时柱暂缺)"}`,`日主:${e.dayMaster.stem}${e.dayMaster.element}(${e.dayMaster.yinYang}) 空亡:${e.kongwang.join("")}`,a("年柱",t.year),a("月柱",t.month),a("日柱",t.day),...vt?[]:[a("时柱",t.hour)],`五行:${n}`,...l?[l]:[],`日主强弱:${e.strength.level}(${e.strength.score}) ${e.strength.detail}`,...xn?[xn]:[],...At,`天干关系:${e.relations&&e.relations.stems.length?e.relations.stems.join(" "):"—"}`,`地支关系:${e.relations&&e.relations.branches.length?e.relations.branches.join(" "):"—"}`,...kn?[kn]:[],Z,`真太阳时:${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}`,...X?[X]:[],`大运:${e.dayun.rule}(${e.dayun.direction}),${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月起运${p}`,...T?[T]:[],` ${r}`,`流年:${e.liunian.slice(0,10).map(ae=>`${ae.year}${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}`).join(" ")}`,(()=>{const ae=e.liunian.filter(xe=>xe.suiyun&&xe.suiyun.signals&&xe.suiyun.signals.length);if(!ae.length)return"岁运提示:近十年无岁运并临、运年反吟或大运/流年伏吟、反吟(只标干支,不判吉凶)";const ge=xe=>`${xe.type}${(xe.type.startsWith("流年")||xe.type.startsWith("大运"))&&xe.target?`(${xe.target})`:""}`,qe=tn(e),Ot=qe?`|古籍见《${Ge[qe.book].name}·${qe.chapter}》`:"";return"岁运提示(只标干支变动,不判吉凶):"+ae.map(xe=>`${xe.year}${xe.ganzhi} ${xe.suiyun.signals.map(ge).join("/")}`).join(";")+Ot})(),"(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)"].join(`
76
+ `)+ee}function Pn(e){const t=e.lunar.monthRaw||e.lunar.month,a=`${e.lunar.year}年${e.lunar.isLeap?`闰${t}`:e.lunar.month}月${e.lunar.day}日`+(e.lunar.isLeap&&e.lunar.month!==t?`(按${e.lunar.month}月起盘)`:""),n=(()=>{if(!e.schools)return"";const ne=Object.entries({brightnessSchool:"亮度",gengYearSihua:"庚干四化",tianmaSchool:"天马",tiankongSchool:"天空",jiekongSchool:"截空",kuiyueSchool:"魁钺",tianshiTianshang:"天伤天使",changshengSchool:"长生",lateZishi:"晚子时",shenzhuSchool:"身主",mingzhuSchool:"命主取法",zuoyaoSchool:"杂曜全表",liunianSihua:"流年四化取干",sihuaVariant:"十干四化变体",jieluSchool:"截路空亡",suipoSchool:"岁前十二神"}).filter(([X])=>e.schools[X]&&e.schools[X]!==c[X]).map(([X,pe])=>`${pe} ${e.schools[X]}`);return ne.length?`【流派】${ne.join(" ")}`:""})(),l=O=>O.length?O.map(ne=>`${ne.name}${ne.mutagen?`化${ne.mutagen}`:""}`).join(" "):"—",r=O=>`神煞:长生(${O.changsheng}) 博士(${O.boshi}) 将前(${O.jiangqian}) 岁前(${O.suiqi})`,p=[];for(const O of e.palaces){const ne=O.isSoul?"【命】":O.isBody?"【身】":"  ";p.push(` ${O.palace} ${O.branch} ${O.ganzhi} ${ne} 大限${String(O.daxian.start).padStart(2)}-${O.daxian.end} 小限${String(O.xiaoxian.age).padStart(2)} ${l(O.stars)}`),p.push(` ${r(O.shensha)}`)}const w=(e.liunian??[]).slice(0,6).map(O=>` ${O.year} ${O.ganzhi} ${String(O.age).padStart(2)}岁 命宫${O.lifePalace.branch}(${O.lifePalace.palace}) 流禄${O.liulu} 流羊${O.liuyang} 流陀${O.liutuo} | ${O.mutagen.map(ne=>ne.replace("化","")).join(" ")}`+(O.mutagenHits?` 四化落宫 ${O.mutagenHits.map(ne=>`${ne.star}${ne.type}→${ne.palace||"未上盘"}`).join("、")}`:"")+(O.sanfangMainStars?` 三方主星 ${O.sanfangMainStars.join("")}`:"")),T=(e.patterns??[]).length?e.patterns.map(O=>`${O.name}(${O.tone==="good"?"吉格":O.tone==="bad"?"忌格":"中"}:${O.evidence})`).join(";"):"无明显格局(按内置规则)",ee=(e.daxianList??[]).slice(0,8).map(O=>` ${O.branch}宫(${O.palace})${O.ages[0]}-${O.ages[1]}岁 ${O.ganzhi} 会${O.mainStars.join("")||"—"} 化 ${O.mutagenHits.map(ne=>`${ne.star}${ne.type}→${ne.palace||"未上盘"}`).join("、")}`),W=(()=>{const O=e.flyChains;if(!O)return"";const ne=pe=>{const de=O[pe];return!de||!de.steps.length?"":`${pe}:${de.path.join("→")}${de.closed?"(成环)":""}`},X=["禄","权","科","忌"].map(ne).filter(Boolean).join(" ");return X?`【命宫飞星】${X}`:""})(),Z=(()=>{const O=e.flyComposite;if(!O||!Array.isArray(O.sources)||!O.sources.length)return"";const ne=O.labels.length?O.labels.join(" · "):"无同宫会聚",X=["禄","权","科","忌"].map(pe=>{const de=(O.byType&&O.byType[pe]||[]).filter(Se=>!Se.self),je=[...new Set(de.map(Se=>String(Se.to).replace(/宫$/,"")))];return je.length?`${pe}→${je.join("/")}`:""}).filter(Boolean).join(" ");return`【三方四正飞化】${O.sanfang.join("·")}:${ne}${X?` ${X}`:""}`})();return[`【农历】${a}(月首 ${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.bodyMasterNote?`(${e.bodyMasterSchool==="common"?"子午皆火星":"子铃午火"})`:""}${e.lifeMasterNote?`(${e.lifeMasterNote})`:""}`,`【大限】${e.daxian.rule},${e.daxian.startAge}岁起 【小限】${e.xiaoxianRule.direction}`,n,`【昌曲】文昌${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})`,W,Z,"十二宫:",...p,"大限(按起运年龄排序,前 8 限,宫干四化落宫):",...ee,"流年(前 6 年,完整 12 年在结构化数据里):",...w,`【格局】${T}`,e.patternSummary?`【结构统计】吉格 ${e.patternSummary.good.length}、中性 ${e.patternSummary.neutral.length}、忌格 ${e.patternSummary.bad.length}${e.patternSummary.broken.length?`、破格 ${e.patternSummary.broken.length}(${e.patternSummary.broken.join("、")})`:""};${e.patternSummary.note}`:"",e.lunar.note?`注:${e.lunar.note}`:""].filter(Boolean).join(`
77
+ `)}const Cn=["旺","相","休","囚","死"];function Rn(e){const t=e.states,a=e.month;if(!t||!a)return"无月令数据";const n=l=>Cn.filter(r=>l&&Array.isArray(l[r])&&l[r].length).map(r=>`${r} ${l[r].join("/")}`).join(" ");return`月令 ${a.branch}(${a.element}) 门 ${n(t.gate)||"—"} 星 ${n(t.star)||"—"} 干 ${n(t.stem)||"—"}`}function Zn(e){const t=e.palaces,a=n=>`${n.palace}宫 ${n.star||"—"}/${n.gate||"—"}/${n.god||"—"}${n.kong?" 空":""}${n.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(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 三奇入墓 ${(e.conditions&&e.conditions.ruMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 六仪入墓 ${(e.conditions&&e.conditions.liuYiRuMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"}`,`【十干克应】${[...t,e.centerPalace].filter(n=>n&&n.ganYing).map(n=>`${n.palace}宫 ${n.ganYing.tian}加${n.ganYing.di} ${n.ganYing.name}`).join(" ")||"—"}`,`【旺衰】${Rn(e)}`,`【九宫】${t.map(a).join(" ")}`,`※ 晚子时:${e.lateZiHourMode==="next-day"?"23:00 后归次日":"23:00 后仍归当日"}(可用 lateZiHourMode / lateZi 指定)`,`※ ${e.rules[e.rules.length-1]}`].join(`
78
+ `)}function gn(e){if(!e||!Array.isArray(e.pairs)||!e.pairs.length)return[];const t=["【三方合盘】三对两两并列,不合成「三人总分」",...e.pairs.map(a=>`· ${a.a}–${a.b}:${a.level||"—"}(${a.total==null?"—":`${a.total}/100`})`)];return e.best&&(e.spread>=3?t.push(` 最顺:${e.best.a}–${e.best.b}(${e.best.total}/100)`+(e.hardest?`;最需磨合:${e.hardest.a}–${e.hardest.b}(${e.hardest.total}/100)`:"")):t.push(` 三对分数接近(最高与最低相差 ${e.spread} 分),不排名`)),e.focus&&e.focus.spread>=3&&t.push(` 差异最大的一维:${e.focus.label}(三对相差 ${e.focus.spread} 分)`),e.note&&t.push(`※ ${e.note}`),t}function Dn(e){if(e.chart==="ziwei"){const n=l=>`${l.label}:${l.score>=0?"+":""}${l.score} ${l.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(n),...e.interactions.map(l=>` · ${l.text}`),...gn(e.triple),...e.notes.map(l=>`※ ${l}`)].join(`
79
+ `)}const t=n=>`${n.label}:${n.score>=0?"+":""}${n.score} ${n.text}`,a=n=>!n||!n.solarNote?"—":`${n.longitude==null?"未含经度修正":`${n.longitude}°E`}(${n.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||""}`,`真太阳时:你 ${a(e.a)};对方 ${a(e.b)}`,...e.dimensions.map(t),...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(n=>`${n.name}(${n.a}${n.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};分档只数象,总分以上面三维度为准)`]:[],...gn(e.triple),...e.notes.map(n=>`※ ${n}`)].join(`
80
+ `)}function Yn(e){const t=e.sanChuan,a=n=>`${n.zhi}(${n.jiang}${n.liuQin}${n.xunKong?"空":""})`;return[`【日时】${e.dayGanZhi}日 ${e.hourZhi}时(${e.dayNight}贵) 月将 ${e.yueJiang.name}${e.yueJiang.zhi} 节气 ${e.jieqi.name} ${e.lateZi===!1?"晚子时不换日":"晚子时换日"}`,`【三传】初 ${a(t.chu)} → 中 ${a(t.zhong)} → 末 ${a(t.mo)}`,`【四课】${e.siKe.map(n=>`${n.position}课 ${n.shang}上${n.xia}下(${n.relation}·${n.jiang})`).join(" ")}`,`【天地盘】${e.pan.map(n=>`${n.di}:${n.tian}(${n.jiang})`).join(" ")}`,`【格局】${e.geJu.name}·${e.geJu.detail}`,...e.shensha&&e.shensha.length?[`【神煞】${e.shensha.map(n=>`${n.name}${n.branch}`).join(" ")}`]:[]].join(`
81
+ `)}function Gn(e){const t=[`【起卦】${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}`],a=e.lines.slice().reverse().map(n=>` ${n.name} ${n.yinYang==="阳"?"━━━━━":"━━ ━━"}${n.moving?" ←动":""}`);return[...t,"【爻】",...a].join(`
82
+ `)}function Un(e){const t=[e.question?`【所问】${e.question}`:"(未填写提问)",`【牌阵】${e.spread}${e.castAt?` 抽牌于 ${e.castAt}`:""}`];for(const a of e.cards){const n=a.astro?` ${a.astro}`:a.role?` ${a.role}`:"",l=a.en?` [${a.en}]`:"";t.push(` ${a.position}:${a.name}${l}(${a.orientation})${n} ${a.keywords.join("、")}`),a.image&&t.push(`    牌面:${a.image}`)}if(e.reading&&e.reading.length){t.push("【解读】");for(const a of e.reading)t.push(` ${a}`)}return t.join(`
83
+ `)}function Hn(e){const t=T=>{const ee=T.lines.slice().reverse().map(W=>{const Z=W.position===T.shi?"世":W.position===T.ying?"应":" ";return` ${W.name} ${Z} ${W.symbol} ${W.ganzhi}${W.element} ${W.liuqin}/${W.liushen}`});return[`${T.name}(${T.palace}·${T.palaceElement})`,...ee].join(`
84
+ `)},a=[`起卦:${e.cast.notation.join("、")}(自下而上)`,`日辰:${e.dayGanZhi.name}`,e.xunShou?`旬首:${e.xunShou} 旬空:${(e.xunKong||[]).join("")||"—"}`:"",e.question?`所问:${e.question}`:"","本卦:",t(e.ben)];e.bian?a.push(`动爻:第 ${e.cast.movingPositions.join("、")} 爻`,"变卦(六亲以变卦自身宫论):",t(e.bian)):a.push("六爻安静,无变卦。");const n=e.body&&Array.isArray(e.body.labels)?e.body.labels:H(e.body);a.push(`卦体:${n.length?n.join(" · "):"无六冲、六合、伏吟、反吟"}`);const l=e.useGod||D(e,{});if(l&&l.liuqin){const T=l.found.length?l.found.map(ne=>`${ne.position}爻${ne.ganzhi}${ne.element}${ne.kong?"(空)":""}`).join("、"):l.fushen.length?l.fushen.map(ne=>`伏 ${ne.position}爻${ne.ganzhi}${ne.element}(${ne.relation||"飞伏关系未知"})`).join("、"):"不上卦";a.push(`用神:${l.byShi?"世爻":l.liuqin}(${l.ask})→ ${T}${l.side?`(${l.side})`:""}`);const ee=l.byShi?"用神 世爻":`用神 ${l.liuqin}`,W=l.labels.filter(ne=>ne!==ee&&!ne.startsWith(ee));W.length&&a.push(`用神联动:${W.join(" · ")}`);const Z=e.useGodStrength;if(Z&&Z.labels.length){const ne=Z.month&&Z.month.branch?`月建 ${Z.month.branch}(${Z.month.element}) `:"";a.push(`用神旺衰:${ne}${Z.labels.join(" · ")}`)}const O=e.fushenAccess;O&&Array.isArray(O.labels)&&O.labels.length&&a.push(`伏神出伏:${O.labels.join(" · ")}`)}else a.push("用神:未取(未指明所问之事;用「询问方向」指定后即按六亲取用)");const r=e.hexStrength;if(r&&Array.isArray(r.labels)&&r.labels.length){const T=r.month&&r.month.branch?`月建 ${r.month.branch}(${r.month.element}) `:"无月建(未给起卦时间) ";a.push(`全卦旺衰:${T}${r.labels.join(" · ")}`)}const p=e.jinTuiPower;p&&Array.isArray(p.lines)&&p.lines.length&&a.push(`进退力重:${p.lines.map(T=>`${T.position}爻${T.from}→${T.to}${T.type}·${T.verdict}`).join(" · ")}`);const w=e.yingqi;return w&&Array.isArray(w.triggers)&&w.triggers.length&&a.push(`应期线索:${w.tempo} · ${w.triggers.map(T=>`${T.labels.join("/")}${T.branch}`).join(" · ")}(只列地支,不出日期)`),a.filter(Boolean).join(`
85
+ `)}function Bn(e){const t=new WeakSet,a=(n,l)=>{switch((n instanceof Number||n instanceof String||n instanceof Boolean)&&(n=n.valueOf()),n&&typeof n=="object"&&typeof n.toJSON=="function"&&(n=n.toJSON(l)),typeof n){case"string":case"boolean":return n;case"number":return Number.isFinite(n)?Object.is(n,-0)?0:n:null;case"bigint":throw new TypeError("Do not know how to serialize a BigInt");case"object":{if(n===null)return null;if(t.has(n))throw new TypeError("Converting circular structure to JSON");t.add(n);let r;if(Array.isArray(n)){r=new Array(n.length);for(let p=0;p<n.length;p++){const w=a(n[p],String(p));r[p]=w===void 0?null:w}}else{r={};for(const p of Object.keys(n)){const w=a(n[p],p);w!==void 0&&(r[p]=w)}}return t.delete(n),r}default:return}};return a(e,"")}const Fn=new Set(["shadow","shadowVersion","diff","trace","traceError","withInterpret","detail","cross","verifyPast","rectify","events","geocode","ask","followup","caliber","seed","asOf","handle","revise","geo","longitudeFromGeo"]),We=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?Number(t.toFixed(6)):null};function Xe(e){if(e==null||e==="")return null;try{const t=fe(e);return{y:t.year,m:t.month,d:t.day,h:t.hour,mi:t.minute,precision:t.precision}}catch{return String(e).trim()}}function Be(e={}){const t={};return e.datetime&&(t.datetime=Xe(e.datetime)),e.gender&&(t.gender=String(e.gender).toLowerCase()),e.longitude!==void 0?t.longitude=We(e.longitude):e.address&&(t.address=String(e.address).trim()),e.lateZi!==void 0&&(t.lateZi=C(e.lateZi,!0)),e.trueSolar!==void 0&&(t.trueSolar=C(e.trueSolar,!0)),e.dst!==void 0&&(t.dst=C(e.dst,!0)),t}function Kn(e){return e.lateZiHourMode==="next-day"||C(e.lateZi)?"next-day":"same-day"}function Jn(e,t){const a=String(t&&t.system||e.system||""),n=t&&t.input&&typeof t.input=="object"?t.input:null;if(a==="bazi"&&n)return{civil:n.civil,gender:n.gender,longitude:We(n.longitude),lateZi:C(n.lateZi,!0),trueSolar:C(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(a==="ziwei"&&n)return{civil:{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute},gender:n.gender,longitude:We(n.longitude),leapMonth:n.leapMonth||"split",leapAsNext:C(n.leapAsNext),schools:n.schools||c,trueSolar:C(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(a==="qimen")return{datetime:Xe(e.datetime),juMethod:e.juMethod||"chaibu",lateZiHourMode:Kn(e)};if(a==="hepan"){const p={chart:e.chart==="ziwei"?"ziwei":"bazi",a:Be({...e,datetime:e.datetime}),b:Be(e.partner||{})};return e.partner2&&(p.c=Be(e.partner2)),p}const l={},r=(p,w)=>Object.defineProperty(l,p,{value:w,enumerable:!0,writable:!0,configurable:!0});for(const[p,w]of Object.entries(e))if(!(Fn.has(p)||w===void 0))if(p==="datetime")r(p,Xe(w));else if(p==="partner")r(p,Be(w));else if(p==="gender")r(p,String(w).toLowerCase());else{if(p==="address")continue;typeof w=="number"?r(p,Number.isFinite(w)?Object.is(w,-0)?0:w:null):typeof w=="string"?r(p,w.trim()):r(p,w)}return a==="daliuren"&&l.lateZi===void 0&&(l.lateZi=!0),a==="tarot"&&l.spread===void 0&&l.count===void 0&&(l.count=3),a==="meihua"&&l.mode===void 0&&(l.mode="time"),a==="xiaoliuren"&&l.mode===void 0&&(l.mode="time"),a==="convert"&&l.mode===void 0&&(l.mode="solar2lunar"),a==="fengshui"&&l.action===void 0&&(l.action="natal"),a==="tarot"&&t&&Array.isArray(t.cards)&&t.cards.length&&(l.cards=t.cards.map(p=>`${p.name||""}|${p.upright?"正":"逆"}`)),a==="liuyao"&&t&&t.cast&&Array.isArray(t.cast.lines)&&(l.cast=t.cast.lines.join("")),l}function Wn(e,t,a=Qe(t.asOf)){const n=t.seed,l=!(n==null||n==="");return e==="liuyao"&&Array.isArray(t.lines)&&t.lines.length===6?{reproducible:!0}:(e==="tarot"||e==="liuyao")&&!l?{reproducible:!1,reason:"未给 seed:重算会变成另一副牌 / 另一卦"}:e==="bazi"||e==="ziwei"||e==="trend"||e==="fengshui"?{reproducible:!0,asOfPinned:!!a}:{reproducible:!0}}function Qe(e){if(e==null||e==="")return null;if(typeof e=="object")return e;const t=String(e).trim();if(!t)return null;const a=s(t);if(!a)return t;const n=r=>String(r).padStart(2,"0");return`${String(a.year).padStart(4,"0")}-${n(a.month)}-${n(a.day)}T${n(a.hour)}:${n(a.minute)}`}function bn(e={},t={}){const a=t.result||null,n=String(a&&a.system||e.system||""),l=String(t.version||typeof globalThis<"u"&&globalThis.__MP_VER||"dev"),r=Qe(e.asOf);return{...Tn({system:n,params:Jn(e,a),seed:e.seed,asOf:r,version:l}),...Wn(n,e,r),system:n,version:l}}const Xn=new Set(["shadow","trace","traceText","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","handle","handleError","revision"]);function wn(e){const t={};for(const[a,n]of Object.entries(e||{}))Xn.has(a)||(t[a]=n);return t}function Qn(e){return!e||!e.shadow||!e.shadow.baseId?null:{snapshot:!0,shadow:e.shadow,data:wn(e)}}function Vn(e,t,a={}){const n=e&&e.shadow,l=t&&t.shadow;if(!n||!l)return{sameId:!1,total:0,reason:"缺少影子盘信息"};if(n.baseId&&l.baseId&&n.baseId!==l.baseId)return{sameId:!1,total:0,fromId:n.id,toId:l.id,fromBaseId:n.baseId,toBaseId:l.baseId,reason:"基础指纹不同,不是同一张盘"};const r=O=>O.snapshot===!0&&O.data&&typeof O.data=="object"?O.data:wn(O),p=on(r(e),r(t)),w=rn(p.filter(O=>ln(O.path))).map(O=>({path:O.path,label:un(O.path),from:Ue(O.from),to:Ue(O.to)})),T=new Map;for(const O of p){const ne=cn(O.path)||"其他";T.set(ne,(T.get(ne)||0)+1)}const ee=[...T.entries()].map(([O,ne])=>({name:O,count:ne})).sort((O,ne)=>ne.count-O.count||O.name.localeCompare(ne.name,"zh-Hans-CN")),W=a.fromVersion||n.version||"",Z=a.toVersion||l.version||"";return{sameId:!0,versionChanged:W!==Z,fromVersion:W,toVersion:Z,total:p.length,summary:sn(p),roots:w,categories:ee,diffs:p}}function Ve(e={}){let t=Y(e),a;if(typeof t.revise=="string"&&t.revise.trim()){const T=ie(t.revise),ee={...t};t={...t,...T.patch},a={text:T.text,applied:T.labels.map(W=>{const Z=ee[W.key]===void 0?null:ee[W.key];return{...W,from:Z,fromDisplay:ue(W.key,Z)}}),ignored:T.ignored},t=K(t,j(e,T.patch))}if(t=Q(t),t=me(t),t.asOf!==void 0&&t.asOf!==null&&t.asOf!==""){const T=Qe(t.asOf);T===null?(t={...t},delete t.asOf):T!==t.asOf&&(t={...t,asOf:T})}if(t.partner2===null&&(t={...t},delete t.partner2),t=Sn(t),t.verifyPast!==void 0&&t.verifyPast!==null&&t.verifyPast!==""){const T=Number(t.verifyPast);if(!Number.isInteger(T)||T<1||T>10)throw re("E_INPUT",`verifyPast 要是 1–10 的整数(年数),收到「${t.verifyPast}」`);t={...t,verifyPast:T}}const n=Bn(st(t));if(n&&!n.question&&typeof t.question=="string"&&t.question.trim()&&["liuyao","meihua","daliuren","qimen","tarot","xiaoliuren"].includes(n.system)&&(n.question=t.question.trim()),n)try{const T=zt(n);T&&(n.brief=T)}catch(T){n.briefError=String(T&&T.message||T)}if(a&&(n.revision=a),n&&n.system==="bazi"){n.classics=zn(n);const T=Nn(n.classics);T&&(n.summary=`${n.summary}
86
86
  【古籍】
87
- ${E}`);const V=tn(n);if(V&&(n.suiyunClassic={...V,bookName:Ge[V.book].name}),n.renyuan){const J=an("smt-renyuan");J&&(n.renyuanClassic={...J,bookName:Ge[J.book].name})}}n&&n.precision&&n.precision.level==="approx"&&n.summary&&(n.summary=`⚠ ${n.precision.note}
87
+ ${T}`);const ee=tn(n);if(ee&&(n.suiyunClassic={...ee,bookName:Ge[ee.book].name}),n.renyuan){const W=an("smt-renyuan");W&&(n.renyuanClassic={...W,bookName:Ge[W.book].name})}}n&&n.precision&&n.precision.level==="approx"&&n.summary&&(n.summary=`⚠ ${n.precision.note}
88
88
  ${n.summary}`),n&&(n.system==="bazi"||n.system==="ziwei")&&n.input&&n.input.longitude==null&&n.summary&&(n.summary=`⚠ 未提供出生地或经度:按东八区平太阳时排盘,时柱可能与本命盘相差一个时辰;海外出生请先把当地时间换算成东八区标准时。
89
89
  ${n.summary}`),n&&n.system==="bazi"&&n.hourUnknown&&n.summary&&(n.summary=`时柱按正午暂算,涉及时柱的结论仅供参考
90
90
  ${n.summary}`),n&&n.system==="trend"&&n.hourUnknown&&n.summary&&(n.summary=`时柱暂缺:起运与大运按日估算,仅供参考
91
- ${n.summary}`);const l=n&&n.system==="meihua"&&t.mode==="number",r=typeof t.datetime=="string"&&t.datetime.trim()!==""&&!/[T\s]\d{1,2}:\d{1,2}/.test(t.datetime.trim()),p=n&&n.system==="name"&&!(typeof t.datetime=="string"&&t.datetime.trim())&&Number.isInteger(t.year)&&Number.isInteger(t.month)&&Number.isInteger(t.day)&&!Number.isInteger(t.hour);if(n&&!l&&!n.hourUnknown&&!n.timeMissing&&qn.has(n.system)&&(r||p)&&n.summary){n.timeMissing=!0;const E=In[n.system]||{what:"时刻",advice:"请补上时刻 HH:mm"};n.summary=`⚠ 只给了日期、没有时刻:${E.what}按 00:00 暂算,与真实结果可能整档不同;${E.advice}
92
- ${n.summary}`}if(n&&n.system==="hepan"&&n.summary){const E=[];for(const[V,J]of[["partner","对方"],["partner2","第三方"]]){const Z=t[V],v=Z&&typeof Z=="object"?Z.datetime:void 0;typeof v=="string"&&!/[T\s]\d{1,2}:\d{1,2}/.test(v.trim())&&E.push(J)}E.length&&(n.timeMissing=!0,n.summary=`⚠ 只给了日期、没有时刻:${E.join("、")}的时柱按 00:00 暂算,与真实结果可能整档不同;请补出生时刻 HH:mm
93
- ${n.summary}`)}const w=ot(t.detail);if(t.withInterpret&&(n.interpret=U(n,{question:typeof t.question=="string"?t.question:"",direction:typeof t.direction=="string"?t.direction:"general"}),n.interpret&&w!=="full"&&(n.interpretTier=w)),C(t.cross)&&C(t.hourUnknown)&&(n.crossSkipped="HOUR_UNKNOWN"),C(t.cross)&&!C(t.hourUnknown)&&(n.system==="bazi"||n.system==="ziwei")){const V={...fe(t.datetime),gender:Me(t.gender),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,trueSolar:C(t.trueSolar,!0),dst:C(t.dst,!0)},J=Le(t.asOf),Z=t.lateZishi!==void 0?t.lateZishi:t.lateZi===void 0||t.lateZi===null||t.lateZi===""?void 0:C(t.lateZi,!0)?"next-day":"current-day",v=n.system==="bazi"?f({...V,leapMonth:t.leapMonth,leapAsNext:C(t.leapAsNext),...pn(t),...Z!==void 0?{lateZishi:Z}:{},asOf:J}):P({...V,lateZi:C(t.lateZi,!0),nowYear:J?J.year:void 0});n.cross=te(n.system==="bazi"?n:v,n.system==="ziwei"?n:v),n.interpret&&n.interpret.sections.push(Ke(n.cross))}if(Number.isInteger(t.verifyPast)&&t.verifyPast>0&&n.system==="bazi"){const E=t.verifyPast,V=Number(n.liunianFrom)-E,J=P({...fe(t.datetime),hourUnknown:C(t.hourUnknown),gender:Me(t.gender),lateZi:C(t.lateZi,!0),trueSolar:C(t.trueSolar,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,dst:C(t.dst,!0),nowYear:V});n.past={rows:Ze(J,Number(n.liunianFrom)-1),years:E,until:Number(n.liunianFrom)-1}}if(C(t.rectify)&&n.system==="bazi"){const E=fe(t.datetime);n.rectify=Ye({base:{year:E.year,month:E.month,day:E.day,minute:E.minute},gender:Me(t.gender),events:Array.isArray(t.events)?t.events:[],hours:Array.isArray(t.rectifyHours)?t.rectifyHours:void 0,lateZi:C(t.lateZi,!0),trueSolar:C(t.trueSolar,!0),dst:C(t.dst,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0})}if(typeof t.ask=="string"&&t.ask.trim()&&(n.followup=be(n,t.ask)),C(t.trace))try{const E=mn(n,{direction:t.direction,gender:t.gender});E&&(n.trace=E,n.traceText=fn(E,{system:n.system}))}catch(E){n.traceError=String(E&&E.message||E)}if(C(t.shadow))try{n.shadow=bn(t,{result:n,version:t.shadowVersion})}catch(E){n.shadow={error:String(E&&E.message||E)}}try{const E=a(t);E&&(n.handle=E)}catch(E){n.handleError=String(E&&E.message||E)}return n}function Sn(e,t){if(!e)return"";const i=t==="brief",l=i||t==="lean",r=8,p=300,w=[`【${e.title||"解析与详解"}】${e.ask&&e.ask.echo?e.ask.echo:""}`];e.answer&&w.push(`▶ ${e.ask&&e.ask.question?"先答所问":"先看结论"}:${e.answer}`),e.plain&&w.push(`▶ 说人话:${e.plain}`),e.lead&&w.push(e.lead),Array.isArray(e.outline)&&e.outline.length&&w.push("一页读懂:"+e.outline.map(W=>`${W.label}·${W.text}`).join(" ")),e.error&&w.push(`⚠ 解析生成失败:${e.error}(上方盘面数据本身可用)`);const E=e.dimensions||[],V=l&&E.some(W=>W&&W.focused)?E.filter(W=>W&&W.focused):E;for(const W of V){const pe=Array.isArray(W.evidence)&&W.evidence.length?`
94
-  依据:${W.evidence.join(";")}${W.confidence?` 置信度:${W.confidence}`:""}`:"",he=W.plain?`(${W.plain})`:"",Se=l?(W.knowledge||[]).length?`
95
-  规则 ${W.knowledge.length} 条未展开(detail:"full" 给出原文与出处)`:"":(W.knowledge||[]).map(je=>`
96
-  规则·${je.gist}〔${je.statusLabel}〕${je.detail} 出处:${je.source}${je.note?` 注:${je.note}`:""}`).join("");w.push(`${W.label}:${he}${W.text}${W.advice?` 建议:${W.advice}`:""}${pe}${Se}`)}const J=e.sections||[],Z=l?J.filter(W=>String(W.text||"").length>p):[];for(const W of J)l&&String(W.text||"").length>p||w.push(`${W.label}:${W.text}`);Z.length&&w.push(`(另有 ${Z.length} 节长论述未展开:${Z.map(W=>W.label).join("、")}。需要原文与出处时传 detail:"full")`);for(const W of e.tables||[]){if(!Array.isArray(W.rows)||!W.rows.length)continue;let pe=W.rows;w.push(`【${W.title}】`),i&&pe.length>r&&(pe=pe.slice(0,r),w.push(`(共 ${W.rows.length} 行,仅列前 ${r} 行;全表传 detail:"lean")`)),w.push([W.columns.join(" | "),...pe.map(he=>he.join(" | "))].join(`
97
- `))}Array.isArray(e.followups)&&e.followups.length&&w.push("还可以这样追问:"+e.followups.map(W=>`「${W}」`).join(" ")),!i&&Array.isArray(e.glossary)&&e.glossary.length&&w.push("名词解释:"+e.glossary.map(W=>`${W.term}=${W.plain}`).join(" "));let v="";Array.isArray(e.limits)&&e.limits.length&&(v+=`【本插件不回答什么】${e.limits.map(W=>`${W.title}——${W.text}`).join(`
91
+ ${n.summary}`);const l=n&&n.system==="meihua"&&t.mode==="number",r=typeof t.datetime=="string"&&t.datetime.trim()!==""&&!/[T\s]\d{1,2}:\d{1,2}/.test(t.datetime.trim()),p=n&&n.system==="name"&&!(typeof t.datetime=="string"&&t.datetime.trim())&&Number.isInteger(t.year)&&Number.isInteger(t.month)&&Number.isInteger(t.day)&&!Number.isInteger(t.hour);if(n&&!l&&!n.hourUnknown&&!n.timeMissing&&qn.has(n.system)&&(r||p)&&n.summary){n.timeMissing=!0;const T=In[n.system]||{what:"时刻",advice:"请补上时刻 HH:mm"};n.summary=`⚠ 只给了日期、没有时刻:${T.what}按 00:00 暂算,与真实结果可能整档不同;${T.advice}
92
+ ${n.summary}`}if(n&&n.system==="hepan"&&n.summary){const T=[];for(const[ee,W]of[["partner","对方"],["partner2","第三方"]]){const Z=t[ee],O=Z&&typeof Z=="object"?Z.datetime:void 0;typeof O=="string"&&!/[T\s]\d{1,2}:\d{1,2}/.test(O.trim())&&T.push(W)}T.length&&(n.timeMissing=!0,n.summary=`⚠ 只给了日期、没有时刻:${T.join("、")}的时柱按 00:00 暂算,与真实结果可能整档不同;请补出生时刻 HH:mm
93
+ ${n.summary}`)}const w=ot(t.detail);if(t.withInterpret&&(n.interpret=U(n,{question:typeof t.question=="string"?t.question:"",direction:typeof t.direction=="string"?t.direction:"general"}),n.interpret&&w!=="full"&&(n.interpretTier=w)),C(t.cross)&&C(t.hourUnknown)&&(n.crossSkipped="HOUR_UNKNOWN"),C(t.cross)&&!C(t.hourUnknown)&&(n.system==="bazi"||n.system==="ziwei")){const ee={...fe(t.datetime),gender:Me(t.gender),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,trueSolar:C(t.trueSolar,!0),dst:C(t.dst,!0)},W=Le(t.asOf),Z=t.lateZishi!==void 0?t.lateZishi:t.lateZi===void 0||t.lateZi===null||t.lateZi===""?void 0:C(t.lateZi,!0)?"next-day":"current-day",O=n.system==="bazi"?f({...ee,leapMonth:t.leapMonth,leapAsNext:C(t.leapAsNext),...pn(t),...Z!==void 0?{lateZishi:Z}:{},asOf:W}):P({...ee,lateZi:C(t.lateZi,!0),nowYear:W?W.year:void 0});n.cross=te(n.system==="bazi"?n:O,n.system==="ziwei"?n:O),n.interpret&&n.interpret.sections.push(Ke(n.cross))}if(Number.isInteger(t.verifyPast)&&t.verifyPast>0&&n.system==="bazi"){const T=t.verifyPast,ee=Number(n.liunianFrom)-T,W=P({...fe(t.datetime),hourUnknown:C(t.hourUnknown),gender:Me(t.gender),lateZi:C(t.lateZi,!0),trueSolar:C(t.trueSolar,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,dst:C(t.dst,!0),nowYear:ee});n.past={rows:Ze(W,Number(n.liunianFrom)-1),years:T,until:Number(n.liunianFrom)-1}}if(C(t.rectify)&&n.system==="bazi"){const T=fe(t.datetime);n.rectify=De({base:{year:T.year,month:T.month,day:T.day,minute:T.minute},gender:Me(t.gender),events:Array.isArray(t.events)?t.events:[],hours:Array.isArray(t.rectifyHours)?t.rectifyHours:void 0,lateZi:C(t.lateZi,!0),trueSolar:C(t.trueSolar,!0),dst:C(t.dst,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0})}if(typeof t.ask=="string"&&t.ask.trim()&&(n.followup=be(n,t.ask)),C(t.trace))try{const T=mn(n,{direction:t.direction,gender:t.gender});T&&(n.trace=T,n.traceText=fn(T,{system:n.system}))}catch(T){n.traceError=String(T&&T.message||T)}if(C(t.shadow))try{n.shadow=bn(t,{result:n,version:t.shadowVersion})}catch(T){n.shadow={error:String(T&&T.message||T)}}try{const T=i(t);T&&(n.handle=T)}catch(T){n.handleError=String(T&&T.message||T)}return n}function jn(e,t){if(!e)return"";const a=t==="brief",l=a||t==="lean",r=8,p=300,w=[`【${e.title||"解析与详解"}】${e.ask&&e.ask.echo?e.ask.echo:""}`];e.answer&&w.push(`▶ ${e.ask&&e.ask.question?"先答所问":"先看结论"}:${e.answer}`),e.plain&&w.push(`▶ 说人话:${e.plain}`),e.lead&&w.push(e.lead),Array.isArray(e.outline)&&e.outline.length&&w.push("一页读懂:"+e.outline.map(X=>`${X.label}·${X.text}`).join(" ")),e.error&&w.push(`⚠ 解析生成失败:${e.error}(上方盘面数据本身可用)`);const T=e.dimensions||[],ee=l&&T.some(X=>X&&X.focused)?T.filter(X=>X&&X.focused):T;for(const X of ee){const pe=Array.isArray(X.evidence)&&X.evidence.length?`
94
+  依据:${X.evidence.join(";")}${X.confidence?` 置信度:${X.confidence}`:""}`:"",de=X.plain?`(${X.plain})`:"",je=l?(X.knowledge||[]).length?`
95
+  规则 ${X.knowledge.length} 条未展开(detail:"full" 给出原文与出处)`:"":(X.knowledge||[]).map(Se=>`
96
+  规则·${Se.gist}〔${Se.statusLabel}〕${Se.detail} 出处:${Se.source}${Se.note?` 注:${Se.note}`:""}`).join("");w.push(`${X.label}:${de}${X.text}${X.advice?` 建议:${X.advice}`:""}${pe}${je}`)}const W=e.sections||[],Z=l?W.filter(X=>String(X.text||"").length>p):[];for(const X of W)l&&String(X.text||"").length>p||w.push(`${X.label}:${X.text}`);Z.length&&w.push(`(另有 ${Z.length} 节长论述未展开:${Z.map(X=>X.label).join("、")}。需要原文与出处时传 detail:"full")`);for(const X of e.tables||[]){if(!Array.isArray(X.rows)||!X.rows.length)continue;let pe=X.rows;w.push(`【${X.title}】`),a&&pe.length>r&&(pe=pe.slice(0,r),w.push(`(共 ${X.rows.length} 行,仅列前 ${r} 行;全表传 detail:"lean")`)),w.push([X.columns.join(" | "),...pe.map(de=>de.join(" | "))].join(`
97
+ `))}Array.isArray(e.followups)&&e.followups.length&&w.push("还可以这样追问:"+e.followups.map(X=>`「${X}」`).join(" ")),!a&&Array.isArray(e.glossary)&&e.glossary.length&&w.push("名词解释:"+e.glossary.map(X=>`${X.term}=${X.plain}`).join(" "));let O="";Array.isArray(e.limits)&&e.limits.length&&(O+=`【本插件不回答什么】${e.limits.map(X=>`${X.title}——${X.text}`).join(`
98
98
  `)}
99
- `),e.disclaimer&&(v+=e.disclaimer);const ne=w.join(`
100
- `);return v?`${ne}
101
- ${v}`:ne}const et=["cross","verifyPast","withInterpret","detail","question","direction","ask","geocode","rectify","events","shadow","trace"];function nt(e={},t={}){const i=t.system||e.system,n=t.switches||An[i]||[];if(!n.length)return{system:i,switches:[],affected:0,total:0};const l={...e};for(const p of et)delete l[p];const r=n.map(p=>{const w=p.read(l),E=p.alt(w);let V=[],J="",Z=null,v=null;try{Z=Ve({...l,[p.key]:w}),v=Ve({...l,[p.key]:E}),V=on(Z,v)}catch(he){J=he&&he.message||String(he)}const ne=rn(V.filter(he=>ln(he.path))).map(he=>({path:he.path,label:un(he.path),from:Ue(he.from),to:Ue(he.to)})),W=new Map;for(const he of V){const Se=cn(he.path)||"其他";W.set(Se,(W.get(Se)||0)+1)}const pe=[...W.entries()].map(([he,Se])=>({name:he,count:Se})).sort((he,Se)=>Se.count-he.count||he.name.localeCompare(Se.name,"zh-Hans-CN"));return{key:p.key,title:p.title,short:p.short,current:w,alt:E,currentLabel:p.label(w),altLabel:p.label(E),total:V.length,summary:J?"":sn(V),views:J?[]:En(i,Z,v),roots:ne,categories:pe,error:J}});return{system:i,switches:r,affected:r.filter(p=>!p.error&&p.total>0).length,total:r.reduce((p,w)=>p+w.total,0)}}const tt=["chaibu","chaoshen","zhirun"],it=[1,3,5],at=["same-day","next-day"];function en(e,t=""){if(e==null||e==="")return;const i=t?`${t}的`:"";let n;if(typeof e=="number")n=e;else if(typeof e=="string"){const l=e.trim();if(!/^[+-]?(\d+(\.\d*)?|\.\d+)$/.test(l))throw re("E_RANGE",`${i}经度不是十进制数字:收到「${e}」。经度写数字即可,例如北京 116.4`);n=Number(l)}else throw re("E_RANGE",`${i}经度必须是数字或数字字符串,收到 ${Array.isArray(e)?"array":typeof e}`);if(!Number.isFinite(n))throw re("E_RANGE",`${i}经度不是有限数值:收到「${e}」。经度写十进制数字即可,例如北京 116.4`);if(n<-180||n>180)throw re("E_RANGE",`${i}经度要在 −180 到 180 之间(东经为正),收到 ${n}`);return n}function jn(e){const t=en(e.longitude,""),i=e.partner&&typeof e.partner=="object"?en(e.partner.longitude,"对方"):void 0,n=e.partner2&&typeof e.partner2=="object"?en(e.partner2.longitude,"第三方"):void 0;if(!(t!==void 0&&e.longitude!==t||i!==void 0&&e.partner.longitude!==i||n!==void 0&&e.partner2.longitude!==n))return e;const r={...e};return t!==void 0&&(r.longitude=t),i!==void 0&&(r.partner={...r.partner,longitude:i}),n!==void 0&&(r.partner2={...r.partner2,longitude:n}),r}function ot(e){if(e==null||e==="")return"full";if(e==="full"||e==="lean"||e==="brief")return e;throw re("E_INPUT",`detail 只能是 'full' / 'lean' / 'brief':收到「${String(e).slice(0,24)}」`)}function Le(e){if(e==null||typeof e=="string"&&!e.trim())return;const t=s(e);if(!t)throw re("E_ASOF",`无法解析 asOf:「${e}」,请用 2026-10-22T16:00 这种格式`);const{year:i,month:n,day:l,hour:r,minute:p}=t;if(i<$n||i>yn)throw re("E_ASOF",`asOf 的年份超出可计算范围(${$n}–${yn}):${e}`);if(!(n>=1&&n<=12)||!(l>=1&&l<=vn(i,n)))throw re("E_ASOF",`asOf 指向的日期不存在:${e}`);if(r!==void 0&&!(r>=0&&r<=23))throw re("E_ASOF",`asOf 的小时要在 0–23 之间:${e}`);if(p!==void 0&&!(p>=0&&p<=59))throw re("E_ASOF",`asOf 的分钟要在 0–59 之间:${e}`);return t}function st(e={}){const t=e.system;if(e.mode!==void 0&&e.mode!==null&&e.mode!==""){const i={convert:["solar2lunar","lunar2solar"],meihua:["time","number"],xiaoliuren:["time","number"]},n=i[t];if(!n)throw re("E_INPUT",`mode 只用于 ${Object.keys(i).join(" / ")};${t||"当前体系"} 不收 mode`);if(!n.includes(e.mode))throw re("E_INPUT",`${t} 的 mode 只能是 ${n.join(" / ")},收到「${String(e.mode).slice(0,24)}」`)}if(e.gender!==void 0&&e.gender!==null&&e.gender!==""&&e.gender!=="male"&&e.gender!=="female")throw re("E_INPUT",`gender 只能是 male / female,收到「${String(e.gender).slice(0,24)}」`);if(e.direction!==void 0&&e.direction!==null&&e.direction!==""&&!["general","wealth","career","love","health","study","travel"].includes(e.direction))throw re("E_INPUT",`direction 只能是 general / wealth / career / love / health / study / travel,收到「${String(e.direction).slice(0,24)}」`);if(e.fortuneYear!==void 0&&e.fortuneYear!==null&&e.fortuneYear!==""){const i=Number(e.fortuneYear);if(!Number.isInteger(i))throw re("E_INPUT",`fortuneYear 要是整数年份,收到「${e.fortuneYear}」`);e={...e,fortuneYear:i}}if(t==="bazi"){const i=fe(e.datetime),n=Le(e.asOf),l=P({...i,gender:Me(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:C(e.lateZi,!0),trueSolar:C(e.trueSolar,!0),dst:C(e.dst,!0),nowYear:n?n.year:void 0,hourUnknown:C(e.hourUnknown)});return{...l,...n?{asOf:n}:{},precision:i.precision,summary:Ln(l)}}if(t==="ziwei"){if(C(e.hourUnknown))throw re("HOUR_UNKNOWN","紫微必须有出生时刻:命宫由生月与生时支定,时支未知则整盘不成立。请补上出生时刻,或改用八字三柱模式只看年/月/日。");e.lateZi!==void 0&&e.lateZishi===void 0&&(e={...e,lateZishi:C(e.lateZi,!0)?"next-day":"current-day"});const i=fe(e.datetime),n=Le(e.asOf),l=f({...i,gender:Me(e.gender),leapMonth:e.leapMonth,leapAsNext:C(e.leapAsNext),...pn(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:C(e.trueSolar,!0),dst:C(e.dst,!0),asOf:n});return{...l,...n?{asOf:n}:{},precision:i.precision,summary:Pn(l)}}if(t==="tarot"){const i=e.spread!==void 0&&e.spread!==null&&String(e.spread).trim()!=="";let n;if(i){if(N.indexOf(String(e.spread).trim().toLowerCase())<0)throw re("E_SPREAD",`塔罗牌阵只能是 ${N.join(" / ")},收到「${e.spread}」`);n=void 0}else if(n=e.count===void 0||e.count===null||e.count===""?3:Number(e.count),!it.includes(n))throw re("E_COUNT",`塔罗张数只能是 1 / 3 / 5,收到「${e.count}」`);if(!ze(e.seed))throw re("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);const l=Le(e.asOf),r=u({spread:i?e.spread:void 0,count:n,question:e.question,at:e.asOf,random:$e(e.seed)});return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(r.seed=Number(e.seed)),{...r,...l?{asOf:l}:{},summary:Un(r)}}if(t==="daliuren"){const i=fe(e.datetime),n=C(e.lateZi,!0),l=$({...i,lateZi:n});return l.lateZi=n,{...l,precision:i.precision,summary:Dn(l)}}if(t==="qimen"){const i=fe(e.datetime);if(e.juMethod!==void 0&&!tt.includes(e.juMethod))throw re("E_INPUT",`juMethod 只能是 chaibu / chaoshen / zhirun,收到「${e.juMethod}」`);const n=e.lateZiHourMode!==void 0?e.lateZiHourMode:e.lateZi===void 0||e.lateZi===null?void 0:C(e.lateZi)?"next-day":"same-day";if(n!==void 0&&!at.includes(n))throw re("E_INPUT",`lateZiHourMode 只能是 same-day / next-day,收到「${n}」`);const l=n==="next-day"?"next-day":"same-day",r=d({...i,lateZiHourMode:l,juMethod:e.juMethod});return r.lateZiHourMode=l,{...r,summary:Zn(r)}}if(t==="hepan"){if(C(e.hourUnknown)||e.partner&&C(e.partner.hourUnknown)||e.partner2&&C(e.partner2.hourUnknown))throw re("HOUR_UNKNOWN","合盘需要每一方都有出生时刻:夫妻宫与大运都依赖时支。请补齐时刻后再看,或用八字三柱模式各自看年/月/日。");const n=e.partner;if(!n||typeof n!="object")throw re("E_PARTNER","合盘需要 partner:{ datetime, gender, address? },其中 partner.datetime 是对方的公历出生时间");if(!n.datetime)throw re("E_PARTNER",'缺少 partner.datetime(对方的公历出生时间),例如 partner: {"datetime":"1992-03-03T10:00","gender":"female"}');const l=e.partner2;if(l!=null){if(typeof l!="object"||Array.isArray(l))throw re("E_PARTNER","partner2 需要 { datetime, gender, address? };不想看三方就整段省略(null 视同未传)");if(!l.datetime)throw re("E_PARTNER",'缺少 partner2.datetime(第三方的公历出生时间),例如 partner2: {"datetime":"1988-09-09T08:00","gender":"male"}')}const r=e.chart==="ziwei"?"ziwei":"bazi",p=(Z,v)=>{const ne=fe(Z.datetime),W=Z.lateZishi!==void 0?Z.lateZishi:Z.lateZi===void 0||Z.lateZi===null||Z.lateZi===""?void 0:C(Z.lateZi,!0)?"next-day":"current-day";return{...ne,gender:Me(Z.gender,v),trueSolar:Z.trueSolar,lateZi:Z.lateZi,...W!==void 0?{lateZishi:W}:{},...Z.leapMonth!==void 0?{leapMonth:Z.leapMonth}:{},...Z.leapAsNext!==void 0?{leapAsNext:C(Z.leapAsNext)}:{},dst:C(Z.dst,!0),address:typeof Z.address=="string"?Z.address:void 0,longitude:typeof Z.longitude=="number"?Z.longitude:void 0,geo:Z.geo&&typeof Z.geo=="object"?Z.geo:void 0}},w=p(e,"你(主方)"),E=p(n,"对方"),V=(Z,v)=>r==="ziwei"?h({a:Z,b:v}):g({a:Z,b:v}),J=V(w,E);if(l){const Z=p(l,"第三方");J.triple=o([{key:"a-b",a:"你",b:"对方",result:J},{key:"a-c",a:"你",b:"第三方",result:V(w,Z)},{key:"b-c",a:"对方",b:"第三方",result:V(E,Z)}])}return{...J,summary:Yn(J)}}if(t==="meihua"){let i;e.mode!=="number"&&fe(e.datetime);try{i=j({mode:e.mode==="number"?"number":"time",datetime:e.datetime,upper:e.upper,lower:e.lower,changing:e.changing,lateZi:e.lateZi})}catch(n){const l=n&&n.message||String(n);throw re(n&&n.code||"E_INPUT",n&&n.code?l:`梅花起卦参数不完整:${l}`)}return{...i,summary:Gn(i)}}if(t==="liuyao"){if(!ze(e.seed))throw re("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);let i;if(e.lines===void 0||e.lines===null)i=F($e(e.seed));else{if(!Array.isArray(e.lines))throw re("E_LINES","lines 必须是数组:自下而上 6 个爻值(6 老阴 / 7 少阳 / 8 少阴 / 9 老阳)");if(e.lines.length!==6)throw re("E_LINES",`六爻需要正好 6 个爻值(自下而上),收到 ${e.lines.length} 个;留空则由引擎随机摇卦`);i=e.lines.map(Number)}let n,l=null;const r=e.datetime?fe(e.datetime):Le(e.asOf);if(r){e.datetime||(l=r);const Z=G(se(O(r.year,r.month,r.day)));n={stem:Z.stem,branch:Z.branch,name:Z.name}}let p;try{p=B({lines:i,question:e.question,dayGanZhi:n})}catch(Z){throw re(Z&&Z.code||"E_LINES",Z&&Z.message?Z.message:Z)}const w=Y(p,{direction:e.direction,gender:e.gender});w.liuqin&&(p.useGod=w);let E=null;if(r)try{E=(y({year:r.year,month:r.month,day:r.day,hour:r.hour,minute:r.minute}).monthGanZhi||"")[1]||null}catch{E=null}const V=I(p,{monthBranch:E,dayBranch:p.dayGanZhi.branch});V&&(p.hexStrength=V);const J=k(p,{monthBranch:E,dayBranch:p.dayGanZhi.branch});if(J&&(p.jinTuiPower=J),w.liuqin){const Z=q(p,w,{monthBranch:E,dayBranch:p.dayGanZhi.branch});Z&&(p.useGodStrength=Z);const v=z(p,w,{monthBranch:E,dayBranch:p.dayGanZhi.branch});v&&(p.fushenAccess=v);const ne=m(p,w,{monthBranch:E});ne&&(p.yingqi=ne)}return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(p.seed=Number(e.seed)),{...p,...l?{asOf:l}:{},summary:Hn(p)}}if(t==="almanac"){const i=fe(e.datetime),n=De({year:i.year,month:i.month,day:i.day});return{...n,summary:rt(n)}}if(t==="zeri"){if(!(e.candidates!==void 0&&e.candidates!==null)&&(typeof e.startDate!="string"||!e.startDate.trim()))throw re("E_INPUT",'择日需要 startDate(公历 YYYY-MM-DD,起算日);可另给 days(1–60,默认 30)与 shengXiao(当事人属相)。只想比几天,改给 candidates: ["2026-12-01","2026-12-08"]');let n;try{n=Ie({task:e.task,startDate:e.startDate,days:e.days,shengXiao:e.shengXiao,candidates:e.candidates})}catch(l){throw re(l&&l.code||"E_INPUT",l&&l.message||String(l))}return{...n,summary:ut(n)}}if(t==="chenggu"){const i=fe(e.datetime),n=/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime)),l=Number.isInteger(e.hour)?e.hour:n?i.hour:null;if(l===null||l<0||l>23)throw re("E_INPUT","称骨必须给时辰:datetime 带时分(如 1990-08-15T10:00),或额外给 hour(0–23)——缺时辰四柱不齐");const r=Pe({year:i.year,month:i.month,day:i.day,hour:l,minute:n?i.minute:0,lateZi:e.lateZi});return{...r,summary:lt(r)}}if(t==="convert"){const i=e.mode==="lunar2solar"?"lunar2solar":"solar2lunar";let n;if(i==="lunar2solar"){if(e.lunarYear==null||e.lunarMonth==null||e.lunarDay==null)throw re("E_INPUT","农历转公历需要 lunarYear / lunarMonth / lunarDay(闰月另加 isLeapMonth: true)");n=Re({mode:i,lunarYear:Number(e.lunarYear),lunarMonth:Number(e.lunarMonth),lunarDay:Number(e.lunarDay),isLeapMonth:C(e.isLeapMonth)})}else{const l=fe(e.datetime);n=Re({mode:i,year:l.year,month:l.month,day:l.day})}return{...n,summary:ht(n)}}if(t==="xiaoliuren"){const i=e.datetime?fe(e.datetime):null,n=Ae({mode:e.mode==="number"?"number":"time",date:typeof e.date=="string"&&e.date.trim()?e.date:i?`${i.year}-${i.month}-${i.day}`:void 0,hour:Number.isInteger(e.hour)?e.hour:i&&/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime))?i.hour:void 0,num1:e.num1,num2:e.num2,num3:e.num3,question:e.question,lateZi:e.lateZi});return{...n,summary:ct(n)}}if(t==="star"){const i=fe(e.datetime),n=Ee({year:i.year,month:i.month,day:i.day});return{...n,summary:dt(n)}}if(t==="numerology"){const i=fe(e.datetime),n=Ce({year:i.year,month:i.month,day:i.day});return{...n,summary:mt(n)}}if(t==="wuyunliuqi"){const i=fe(e.datetime),n=Te({year:i.year,month:i.month,day:i.day,hour:i.hour,minute:i.minute});return{...n,summary:$t(n)}}if(t==="taiyi"){const i=fe(e.datetime),n=_e({year:i.year,month:i.month,day:i.day});return{...n,summary:ft(n)}}if(t==="constitution"){if(e.answers===void 0||e.answers===null){const n=de();return{...n,summary:pt(n)}}const i=we({answers:e.answers});return{...i,summary:yt(i)}}if(t==="mbti"){if(e.answers===void 0||e.answers===null){const n=ve();return{...n,summary:bt(n)}}const i=Oe({answers:e.answers});return{...i,summary:gt(i)}}if(t==="trend"){const i=fe(e.datetime),n=e.asOf?Le(e.asOf):void 0,l=dn({...i,nowYear:n?n.year:void 0,gender:Me(e.gender),toAge:e.toAge,lateZi:C(e.lateZi,!0),trueSolar:C(e.trueSolar,!0),dst:C(e.dst,!0),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,hourUnknown:C(e.hourUnknown)});return{...l,...C(e.hourUnknown)?{hourUnknown:!0,hourPrecision:"day"}:{},precision:i.precision,summary:wt(l)}}if(t==="fengshui"){if(e.action!=null&&!["natal","advise","xuankong"].includes(e.action))throw re("E_INPUT",`风水 action 只能是 natal / advise / xuankong,收到「${String(e.action).slice(0,24)}」`);const i=e.action==="advise"?"advise":e.action==="xuankong"?"xuankong":"natal";if(i==="xuankong"){const r=He({action:i,sitting:e.sitting,facing:e.facing,...e.period!==void 0?{period:e.period}:{},...e.fortuneYear!==void 0?{fortuneYear:e.fortuneYear}:{},...typeof e.sittingOffset=="number"?{sittingOffset:e.sittingOffset}:{},...typeof e.sittingDegree=="number"?{sittingDegree:e.sittingDegree}:{},...typeof e.facingOffset=="number"?{facingOffset:e.facingOffset}:{},...typeof e.facingDegree=="number"?{facingDegree:e.facingDegree}:{},...typeof e.fortuneDate=="string"?{fortuneDate:e.fortuneDate}:{},...typeof e.fortuneTime=="string"?{fortuneTime:e.fortuneTime}:{},dst:C(e.dst,!0)});return{...r,summary:nn(r)}}if(i==="advise"){const r=He({action:i,sitting:e.sitting,facing:e.facing,...e.datetime?fe(e.datetime):{},...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},dst:C(e.dst,!0)});return{...r,summary:nn(r)}}const n=fe(e.datetime),l=He({action:"natal",year:n.year,month:n.month,day:n.day,gender:Me(e.gender),fortuneYear:e.fortuneYear,dst:C(e.dst,!0)});return{...l,summary:nn(l)}}if(t==="name"){if(e.action!=null&&!["assess","generate"].includes(e.action))throw re("E_INPUT",`起名 action 只能是 assess / generate,收到「${String(e.action).slice(0,24)}」`);const i=e.action==="generate"?"generate":"assess",n=e.datetime?fe(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}:{}}:{},l=hn({action:i,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,...n,...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},...e.datetime?{lateZi:C(e.lateZi,!0),trueSolar:C(e.trueSolar,!0),dst:C(e.dst,!0),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{...l,summary:St(l)}}throw t?re("E_SYSTEM",`未知体系「${t}」,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。`):re("E_INPUT","缺少 system,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。")}function rt(e){const t=e.ganzhi,i=e.jieQi&&e.jieQi.next?` 下一节:${e.jieQi.next.name} ${e.jieQi.next.date}`:"",n=e.dayGod?`值日:${e.dayGod.name}(${e.dayGod.type}·${e.dayGod.luck})`:"",l=e.xiu?`二十八宿:${e.xiu.name}宿(${e.xiu.luck}·${e.xiu.zheng}·${e.xiu.animal})`:"",r=e.taiShen?`胎神:${e.taiShen}`:"",p=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:"—"}`:"",w=e.lucky?`吉配生肖:六合${e.lucky.liuhe||"—"} 三合${(e.lucky.sanhe||[]).join("、")||"—"}`:"",E=e.nayin&&e.nayin.day?`日柱纳音:${e.nayin.day.name}`:"",V=(e.hours||[]).map(J=>`${J.zhi}${J.ganZhi.slice(0,1)}·${J.shen}${J.luck==="吉"?"吉":"凶"}`).join(" ");return[`【黄历】${e.meta.date} ${e.meta.weekday} ${e.lunar.text}`,`干支:${t.year}年 ${t.month}月 ${t.day}日 属${t.shengXiao}`,...e.meta.boundaryNote?[` ${e.meta.boundaryNote}`]:[],`建除:${e.zhiXing}日 冲:${e.chong.text}${e.chong.sha?`(${e.chong.sha})`:""} ${n}`,[l,E,r].filter(Boolean).join(" "),`宜:${e.yi.join("、")}`,`忌:${e.ji.join("、")}`,p,w,V?`时辰吉凶:${V}`:"",`节气:上一节 ${e.jieQi.prev?`${e.jieQi.prev.name} ${e.jieQi.prev.date}`:"—"}${i}`,e.dailyHexagram?`每日一卦:${e.dailyHexagram.name} ${e.dailyHexagram.meaning||""}`:"",`口径:${e.meta.scope}`].filter(Boolean).join(`
102
- `)}function ut(e){const t=e.compare&&e.compare.mode==="candidates",i=t?`【择日·${e.meta.task}】候选 ${e.meta.days} 天:${e.meta.candidates.join("、")}${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`:`【择日·${e.meta.task}】${e.meta.startDate} 起 ${e.meta.days} 天${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`,n=e.days.slice().sort((r,p)=>p.score-r.score).slice(0,t?12:5).map(r=>{const p=r.grade?`,卷十${r.grade.label}·${r.grade.decision}`:"";return`· ${r.date} ${r.weekday} ${r.verdict}(${r.score}分${p}) 宜${r.yi.slice(0,3).join("/")} ${r.reasons.join(";")||"无特别加减分"}`}),l=t?e.compare.best?`这一组里最优:${e.compare.best.date}(${e.compare.best.score}分,${e.compare.best.verdict})`+(e.compare.best.ties.length>1?`;同分:${e.compare.best.ties.filter(r=>r!==e.compare.best.date).join("、")}`:""):"这一组都因冲属相被排除,没有可用的日子":`推荐日:${e.best.length?e.best.join("、"):"本期无(都不够推荐分)"}`;return[i,l,`推荐日:${e.best.length?e.best.join("、"):"无"}`,`可用日:${e.usable.length?e.usable.join("、"):"无"}`,`回避日:${e.avoid.length?e.avoid.slice(0,6).join("、"):"无"}`,t?"候选日逐日:":"逐日排序:",...n,...t?[`比较口径:${e.compare.note}`]:[],`神煞依据:${e.shenshaRef.text};起法 ${e.shenshaRef.volumes.join("、")}。未实现起法:${e.shenshaRef.unsupported.join("、")}(不计分,逐日 shensha.unsupported 列出)。`,...e.shenshaRef.juan10?[`卷十依据:${e.shenshaRef.juan10.text}(${e.shenshaRef.juan10.corpusLines});${e.shenshaRef.juan10.thresholdsNote}`]:[],`口径:${e.meta.scope}`].join(`
99
+ `),e.disclaimer&&(O+=e.disclaimer);const ne=w.join(`
100
+ `);return O?`${ne}
101
+ ${O}`:ne}const et=["cross","verifyPast","withInterpret","detail","question","direction","ask","geocode","rectify","events","shadow","trace"];function nt(e={},t={}){const a=t.system||e.system,n=t.switches||An[a]||[];if(!n.length)return{system:a,switches:[],affected:0,total:0};const l={...e};for(const p of et)delete l[p];const r=n.map(p=>{const w=p.read(l),T=p.alt(w);let ee=[],W="",Z=null,O=null;try{Z=Ve({...l,[p.key]:w}),O=Ve({...l,[p.key]:T}),ee=on(Z,O)}catch(de){W=de&&de.message||String(de)}const ne=rn(ee.filter(de=>ln(de.path))).map(de=>({path:de.path,label:un(de.path),from:Ue(de.from),to:Ue(de.to)})),X=new Map;for(const de of ee){const je=cn(de.path)||"其他";X.set(je,(X.get(je)||0)+1)}const pe=[...X.entries()].map(([de,je])=>({name:de,count:je})).sort((de,je)=>je.count-de.count||de.name.localeCompare(je.name,"zh-Hans-CN"));return{key:p.key,title:p.title,short:p.short,current:w,alt:T,currentLabel:p.label(w),altLabel:p.label(T),total:ee.length,summary:W?"":sn(ee),views:W?[]:En(a,Z,O),roots:ne,categories:pe,error:W}});return{system:a,switches:r,affected:r.filter(p=>!p.error&&p.total>0).length,total:r.reduce((p,w)=>p+w.total,0)}}const tt=["chaibu","chaoshen","zhirun"],it=[1,3,5],at=["same-day","next-day"];function en(e,t=""){if(e==null||e==="")return;const a=t?`${t}的`:"";let n;if(typeof e=="number")n=e;else if(typeof e=="string"){const l=e.trim();if(!/^[+-]?(\d+(\.\d*)?|\.\d+)$/.test(l))throw re("E_RANGE",`${a}经度不是十进制数字:收到「${e}」。经度写数字即可,例如北京 116.4`);n=Number(l)}else throw re("E_RANGE",`${a}经度必须是数字或数字字符串,收到 ${Array.isArray(e)?"array":typeof e}`);if(!Number.isFinite(n))throw re("E_RANGE",`${a}经度不是有限数值:收到「${e}」。经度写十进制数字即可,例如北京 116.4`);if(n<-180||n>180)throw re("E_RANGE",`${a}经度要在 −180 到 180 之间(东经为正),收到 ${n}`);return n}function Sn(e){const t=en(e.longitude,""),a=e.partner&&typeof e.partner=="object"?en(e.partner.longitude,"对方"):void 0,n=e.partner2&&typeof e.partner2=="object"?en(e.partner2.longitude,"第三方"):void 0;if(!(t!==void 0&&e.longitude!==t||a!==void 0&&e.partner.longitude!==a||n!==void 0&&e.partner2.longitude!==n))return e;const r={...e};return t!==void 0&&(r.longitude=t),a!==void 0&&(r.partner={...r.partner,longitude:a}),n!==void 0&&(r.partner2={...r.partner2,longitude:n}),r}function ot(e){if(e==null||e==="")return"full";if(e==="full"||e==="lean"||e==="brief")return e;throw re("E_INPUT",`detail 只能是 'full' / 'lean' / 'brief':收到「${String(e).slice(0,24)}」`)}function Le(e){if(e==null||typeof e=="string"&&!e.trim())return;const t=s(e);if(!t)throw re("E_ASOF",`无法解析 asOf:「${e}」,请用 2026-10-22T16:00 这种格式`);const{year:a,month:n,day:l,hour:r,minute:p}=t;if(a<$n||a>yn)throw re("E_ASOF",`asOf 的年份超出可计算范围(${$n}–${yn}):${e}`);if(!(n>=1&&n<=12)||!(l>=1&&l<=On(a,n)))throw re("E_ASOF",`asOf 指向的日期不存在:${e}`);if(r!==void 0&&!(r>=0&&r<=23))throw re("E_ASOF",`asOf 的小时要在 0–23 之间:${e}`);if(p!==void 0&&!(p>=0&&p<=59))throw re("E_ASOF",`asOf 的分钟要在 0–59 之间:${e}`);return t}function st(e={}){const t=e.system;if(e.mode!==void 0&&e.mode!==null&&e.mode!==""){const a={convert:["solar2lunar","lunar2solar"],meihua:["time","number"],xiaoliuren:["time","number"]},n=a[t];if(!n)throw re("E_INPUT",`mode 只用于 ${Object.keys(a).join(" / ")};${t||"当前体系"} 不收 mode`);if(!n.includes(e.mode))throw re("E_INPUT",`${t} 的 mode 只能是 ${n.join(" / ")},收到「${String(e.mode).slice(0,24)}」`)}if(e.gender!==void 0&&e.gender!==null&&e.gender!==""&&e.gender!=="male"&&e.gender!=="female")throw re("E_INPUT",`gender 只能是 male / female,收到「${String(e.gender).slice(0,24)}」`);if(e.direction!==void 0&&e.direction!==null&&e.direction!==""&&!["general","wealth","career","love","health","study","travel"].includes(e.direction))throw re("E_INPUT",`direction 只能是 general / wealth / career / love / health / study / travel,收到「${String(e.direction).slice(0,24)}」`);if(e.fortuneYear!==void 0&&e.fortuneYear!==null&&e.fortuneYear!==""){const a=Number(e.fortuneYear);if(!Number.isInteger(a))throw re("E_INPUT",`fortuneYear 要是整数年份,收到「${e.fortuneYear}」`);e={...e,fortuneYear:a}}if(t==="bazi"){const a=fe(e.datetime),n=Le(e.asOf),l=P({...a,gender:Me(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:C(e.lateZi,!0),trueSolar:C(e.trueSolar,!0),dst:C(e.dst,!0),nowYear:n?n.year:void 0,hourUnknown:C(e.hourUnknown)});return{...l,...n?{asOf:n}:{},precision:a.precision,summary:Ln(l)}}if(t==="ziwei"){if(C(e.hourUnknown))throw re("HOUR_UNKNOWN","紫微必须有出生时刻:命宫由生月与生时支定,时支未知则整盘不成立。请补上出生时刻,或改用八字三柱模式只看年/月/日。");e.lateZi!==void 0&&e.lateZishi===void 0&&(e={...e,lateZishi:C(e.lateZi,!0)?"next-day":"current-day"});const a=fe(e.datetime),n=Le(e.asOf),l=f({...a,gender:Me(e.gender),leapMonth:e.leapMonth,leapAsNext:C(e.leapAsNext),...pn(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:C(e.trueSolar,!0),dst:C(e.dst,!0),asOf:n});return{...l,...n?{asOf:n}:{},precision:a.precision,summary:Pn(l)}}if(t==="tarot"){const a=e.spread!==void 0&&e.spread!==null&&String(e.spread).trim()!=="";let n;if(a){if(N.indexOf(String(e.spread).trim().toLowerCase())<0)throw re("E_SPREAD",`塔罗牌阵只能是 ${N.join(" / ")},收到「${e.spread}」`);n=void 0}else if(n=e.count===void 0||e.count===null||e.count===""?3:Number(e.count),!it.includes(n))throw re("E_COUNT",`塔罗张数只能是 1 / 3 / 5,收到「${e.count}」`);if(!ze(e.seed))throw re("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);const l=Le(e.asOf),r=u({spread:a?e.spread:void 0,count:n,question:e.question,at:e.asOf,random:$e(e.seed)});return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(r.seed=Number(e.seed)),{...r,...l?{asOf:l}:{},summary:Un(r)}}if(t==="daliuren"){const a=fe(e.datetime),n=C(e.lateZi,!0),l=$({...a,lateZi:n});return l.lateZi=n,{...l,precision:a.precision,summary:Yn(l)}}if(t==="qimen"){const a=fe(e.datetime);if(e.juMethod!==void 0&&!tt.includes(e.juMethod))throw re("E_INPUT",`juMethod 只能是 chaibu / chaoshen / zhirun,收到「${e.juMethod}」`);const n=e.lateZiHourMode!==void 0?e.lateZiHourMode:e.lateZi===void 0||e.lateZi===null?void 0:C(e.lateZi)?"next-day":"same-day";if(n!==void 0&&!at.includes(n))throw re("E_INPUT",`lateZiHourMode 只能是 same-day / next-day,收到「${n}」`);const l=n==="next-day"?"next-day":"same-day",r=h({...a,lateZiHourMode:l,juMethod:e.juMethod});return r.lateZiHourMode=l,{...r,summary:Zn(r)}}if(t==="hepan"){if(C(e.hourUnknown)||e.partner&&C(e.partner.hourUnknown)||e.partner2&&C(e.partner2.hourUnknown))throw re("HOUR_UNKNOWN","合盘需要每一方都有出生时刻:夫妻宫与大运都依赖时支。请补齐时刻后再看,或用八字三柱模式各自看年/月/日。");const n=e.partner;if(!n||typeof n!="object")throw re("E_PARTNER","合盘需要 partner:{ datetime, gender, address? },其中 partner.datetime 是对方的公历出生时间");if(!n.datetime)throw re("E_PARTNER",'缺少 partner.datetime(对方的公历出生时间),例如 partner: {"datetime":"1992-03-03T10:00","gender":"female"}');const l=e.partner2;if(l!=null){if(typeof l!="object"||Array.isArray(l))throw re("E_PARTNER","partner2 需要 { datetime, gender, address? };不想看三方就整段省略(null 视同未传)");if(!l.datetime)throw re("E_PARTNER",'缺少 partner2.datetime(第三方的公历出生时间),例如 partner2: {"datetime":"1988-09-09T08:00","gender":"male"}')}const r=e.chart==="ziwei"?"ziwei":"bazi",p=(Z,O)=>{const ne=fe(Z.datetime),X=Z.lateZishi!==void 0?Z.lateZishi:Z.lateZi===void 0||Z.lateZi===null||Z.lateZi===""?void 0:C(Z.lateZi,!0)?"next-day":"current-day";return{...ne,gender:Me(Z.gender,O),trueSolar:Z.trueSolar,lateZi:Z.lateZi,...X!==void 0?{lateZishi:X}:{},...Z.leapMonth!==void 0?{leapMonth:Z.leapMonth}:{},...Z.leapAsNext!==void 0?{leapAsNext:C(Z.leapAsNext)}:{},dst:C(Z.dst,!0),address:typeof Z.address=="string"?Z.address:void 0,longitude:typeof Z.longitude=="number"?Z.longitude:void 0,geo:Z.geo&&typeof Z.geo=="object"?Z.geo:void 0}},w=p(e,"你(主方)"),T=p(n,"对方"),ee=(Z,O)=>r==="ziwei"?d({a:Z,b:O}):g({a:Z,b:O}),W=ee(w,T);if(l){const Z=p(l,"第三方");W.triple=o([{key:"a-b",a:"你",b:"对方",result:W},{key:"a-c",a:"你",b:"第三方",result:ee(w,Z)},{key:"b-c",a:"对方",b:"第三方",result:ee(T,Z)}])}return{...W,summary:Dn(W)}}if(t==="meihua"){let a;e.mode!=="number"&&fe(e.datetime);try{a=S({mode:e.mode==="number"?"number":"time",datetime:e.datetime,upper:e.upper,lower:e.lower,changing:e.changing,lateZi:e.lateZi})}catch(n){const l=n&&n.message||String(n);throw re(n&&n.code||"E_INPUT",n&&n.code?l:`梅花起卦参数不完整:${l}`)}return{...a,summary:Gn(a)}}if(t==="liuyao"){if(!ze(e.seed))throw re("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);let a;if(e.lines===void 0||e.lines===null)a=F($e(e.seed));else{if(!Array.isArray(e.lines))throw re("E_LINES","lines 必须是数组:自下而上 6 个爻值(6 老阴 / 7 少阳 / 8 少阴 / 9 老阳)");if(e.lines.length!==6)throw re("E_LINES",`六爻需要正好 6 个爻值(自下而上),收到 ${e.lines.length} 个;留空则由引擎随机摇卦`);a=e.lines.map(Number)}let n,l=null;const r=e.datetime?fe(e.datetime):Le(e.asOf);if(r){e.datetime||(l=r);const Z=G(se(v(r.year,r.month,r.day)));n={stem:Z.stem,branch:Z.branch,name:Z.name}}let p;try{p=B({lines:a,question:e.question,dayGanZhi:n})}catch(Z){throw re(Z&&Z.code||"E_LINES",Z&&Z.message?Z.message:Z)}const w=D(p,{direction:e.direction,gender:e.gender});w.liuqin&&(p.useGod=w);let T=null;if(r)try{T=(y({year:r.year,month:r.month,day:r.day,hour:r.hour,minute:r.minute}).monthGanZhi||"")[1]||null}catch{T=null}const ee=I(p,{monthBranch:T,dayBranch:p.dayGanZhi.branch});ee&&(p.hexStrength=ee);const W=k(p,{monthBranch:T,dayBranch:p.dayGanZhi.branch});if(W&&(p.jinTuiPower=W),w.liuqin){const Z=q(p,w,{monthBranch:T,dayBranch:p.dayGanZhi.branch});Z&&(p.useGodStrength=Z);const O=z(p,w,{monthBranch:T,dayBranch:p.dayGanZhi.branch});O&&(p.fushenAccess=O);const ne=m(p,w,{monthBranch:T});ne&&(p.yingqi=ne)}return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(p.seed=Number(e.seed)),{...p,...l?{asOf:l}:{},summary:Hn(p)}}if(t==="almanac"){const a=fe(e.datetime),n=Ye({year:a.year,month:a.month,day:a.day});return{...n,summary:rt(n)}}if(t==="zeri"){if(!(e.candidates!==void 0&&e.candidates!==null)&&(typeof e.startDate!="string"||!e.startDate.trim()))throw re("E_INPUT",'择日需要 startDate(公历 YYYY-MM-DD,起算日);可另给 days(1–60,默认 30)与 shengXiao(当事人属相)。只想比几天,改给 candidates: ["2026-12-01","2026-12-08"]');let n;try{n=Ie({task:e.task,startDate:e.startDate,days:e.days,shengXiao:e.shengXiao,candidates:e.candidates})}catch(l){throw re(l&&l.code||"E_INPUT",l&&l.message||String(l))}return{...n,summary:ut(n)}}if(t==="chenggu"){const a=fe(e.datetime),n=/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime)),l=Number.isInteger(e.hour)?e.hour:n?a.hour:null;if(l===null||l<0||l>23)throw re("E_INPUT","称骨必须给时辰:datetime 带时分(如 1990-08-15T10:00),或额外给 hour(0–23)——缺时辰四柱不齐");const r=Pe({year:a.year,month:a.month,day:a.day,hour:l,minute:n?a.minute:0,lateZi:e.lateZi});return{...r,summary:lt(r)}}if(t==="convert"){const a=e.mode==="lunar2solar"?"lunar2solar":"solar2lunar";let n;if(a==="lunar2solar"){if(e.lunarYear==null||e.lunarMonth==null||e.lunarDay==null)throw re("E_INPUT","农历转公历需要 lunarYear / lunarMonth / lunarDay(闰月另加 isLeapMonth: true)");n=Re({mode:a,lunarYear:Number(e.lunarYear),lunarMonth:Number(e.lunarMonth),lunarDay:Number(e.lunarDay),isLeapMonth:C(e.isLeapMonth)})}else{const l=fe(e.datetime);n=Re({mode:a,year:l.year,month:l.month,day:l.day})}return{...n,summary:dt(n)}}if(t==="xiaoliuren"){const a=e.datetime?fe(e.datetime):null,n=Ae({mode:e.mode==="number"?"number":"time",date:typeof e.date=="string"&&e.date.trim()?e.date:a?`${a.year}-${a.month}-${a.day}`:void 0,hour:Number.isInteger(e.hour)?e.hour:a&&/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime))?a.hour:void 0,num1:e.num1,num2:e.num2,num3:e.num3,question:e.question,lateZi:e.lateZi});return{...n,summary:ct(n)}}if(t==="star"){const a=fe(e.datetime),n=Ee({year:a.year,month:a.month,day:a.day});return{...n,summary:ht(n)}}if(t==="numerology"){const a=fe(e.datetime),n=Ce({year:a.year,month:a.month,day:a.day});return{...n,summary:mt(n)}}if(t==="wuyunliuqi"){const a=fe(e.datetime),n=Te({year:a.year,month:a.month,day:a.day,hour:a.hour,minute:a.minute});return{...n,summary:$t(n)}}if(t==="taiyi"){const a=fe(e.datetime),n=_e({year:a.year,month:a.month,day:a.day,hour:a.hour});return{...n,summary:ft(n)}}if(t==="constitution"){if(e.answers===void 0||e.answers===null){const n=he();return{...n,summary:pt(n)}}const a=we({answers:e.answers});return{...a,summary:yt(a)}}if(t==="mbti"){if(e.answers===void 0||e.answers===null){const n=Oe();return{...n,summary:bt(n)}}const a=ve({answers:e.answers});return{...a,summary:gt(a)}}if(t==="trend"){const a=fe(e.datetime),n=e.asOf?Le(e.asOf):void 0,l=hn({...a,nowYear:n?n.year:void 0,gender:Me(e.gender),toAge:e.toAge,lateZi:C(e.lateZi,!0),trueSolar:C(e.trueSolar,!0),dst:C(e.dst,!0),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,hourUnknown:C(e.hourUnknown)});return{...l,...C(e.hourUnknown)?{hourUnknown:!0,hourPrecision:"day"}:{},precision:a.precision,summary:wt(l)}}if(t==="fengshui"){if(e.action!=null&&!["natal","advise","xuankong"].includes(e.action))throw re("E_INPUT",`风水 action 只能是 natal / advise / xuankong,收到「${String(e.action).slice(0,24)}」`);const a=e.action==="advise"?"advise":e.action==="xuankong"?"xuankong":"natal";if(a==="xuankong"){const r=He({action:a,sitting:e.sitting,facing:e.facing,...e.period!==void 0?{period:e.period}:{},...e.fortuneYear!==void 0?{fortuneYear:e.fortuneYear}:{},...typeof e.sittingOffset=="number"?{sittingOffset:e.sittingOffset}:{},...typeof e.sittingDegree=="number"?{sittingDegree:e.sittingDegree}:{},...typeof e.facingOffset=="number"?{facingOffset:e.facingOffset}:{},...typeof e.facingDegree=="number"?{facingDegree:e.facingDegree}:{},...typeof e.fortuneDate=="string"?{fortuneDate:e.fortuneDate}:{},...typeof e.fortuneTime=="string"?{fortuneTime:e.fortuneTime}:{},dst:C(e.dst,!0)});return{...r,summary:nn(r)}}if(a==="advise"){const r=He({action:a,sitting:e.sitting,facing:e.facing,...e.datetime?fe(e.datetime):{},...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},dst:C(e.dst,!0)});return{...r,summary:nn(r)}}const n=fe(e.datetime),l=He({action:"natal",year:n.year,month:n.month,day:n.day,gender:Me(e.gender),fortuneYear:e.fortuneYear,dst:C(e.dst,!0)});return{...l,summary:nn(l)}}if(t==="name"){if(e.action!=null&&!["assess","generate"].includes(e.action))throw re("E_INPUT",`起名 action 只能是 assess / generate,收到「${String(e.action).slice(0,24)}」`);const a=e.action==="generate"?"generate":"assess",n=e.datetime?fe(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}:{}}:{},l=dn({action:a,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,...n,...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},...e.datetime?{lateZi:C(e.lateZi,!0),trueSolar:C(e.trueSolar,!0),dst:C(e.dst,!0),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{...l,summary:jt(l)}}throw t?re("E_SYSTEM",`未知体系「${t}」,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。`):re("E_INPUT","缺少 system,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。")}function rt(e){const t=e.ganzhi,a=e.jieQi&&e.jieQi.next?` 下一节:${e.jieQi.next.name} ${e.jieQi.next.date}`:"",n=e.dayGod?`值日:${e.dayGod.name}(${e.dayGod.type}·${e.dayGod.luck})`:"",l=e.xiu?`二十八宿:${e.xiu.name}宿(${e.xiu.luck}·${e.xiu.zheng}·${e.xiu.animal})`:"",r=e.taiShen?`胎神:${e.taiShen}`:"",p=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:"—"}`:"",w=e.lucky?`吉配生肖:六合${e.lucky.liuhe||"—"} 三合${(e.lucky.sanhe||[]).join("、")||"—"}`:"",T=e.nayin&&e.nayin.day?`日柱纳音:${e.nayin.day.name}`:"",ee=(e.hours||[]).map(W=>`${W.zhi}${W.ganZhi.slice(0,1)}·${W.shen}${W.luck==="吉"?"吉":"凶"}`).join(" ");return[`【黄历】${e.meta.date} ${e.meta.weekday} ${e.lunar.text}`,`干支:${t.year}年 ${t.month}月 ${t.day}日 属${t.shengXiao}`,...e.meta.boundaryNote?[` ${e.meta.boundaryNote}`]:[],`建除:${e.zhiXing}日 冲:${e.chong.text}${e.chong.sha?`(${e.chong.sha})`:""} ${n}`,[l,T,r].filter(Boolean).join(" "),`宜:${e.yi.join("、")}`,`忌:${e.ji.join("、")}`,p,w,ee?`时辰吉凶:${ee}`:"",`节气:上一节 ${e.jieQi.prev?`${e.jieQi.prev.name} ${e.jieQi.prev.date}`:"—"}${a}`,e.dailyHexagram?`每日一卦:${e.dailyHexagram.name} ${e.dailyHexagram.meaning||""}`:"",`口径:${e.meta.scope}`].filter(Boolean).join(`
102
+ `)}function ut(e){const t=e.compare&&e.compare.mode==="candidates",a=t?`【择日·${e.meta.task}】候选 ${e.meta.days} 天:${e.meta.candidates.join("、")}${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`:`【择日·${e.meta.task}】${e.meta.startDate} 起 ${e.meta.days} 天${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`,n=e.days.slice().sort((r,p)=>p.score-r.score).slice(0,t?12:5).map(r=>{const p=r.grade?`,卷十${r.grade.label}·${r.grade.decision}`:"";return`· ${r.date} ${r.weekday} ${r.verdict}(${r.score}分${p}) 宜${r.yi.slice(0,3).join("/")} ${r.reasons.join(";")||"无特别加减分"}`}),l=t?e.compare.best?`这一组里最优:${e.compare.best.date}(${e.compare.best.score}分,${e.compare.best.verdict})`+(e.compare.best.ties.length>1?`;同分:${e.compare.best.ties.filter(r=>r!==e.compare.best.date).join("、")}`:""):"这一组都因冲属相被排除,没有可用的日子":`推荐日:${e.best.length?e.best.join("、"):"本期无(都不够推荐分)"}`;return[a,l,`推荐日:${e.best.length?e.best.join("、"):"无"}`,`可用日:${e.usable.length?e.usable.join("、"):"无"}`,`回避日:${e.avoid.length?e.avoid.slice(0,6).join("、"):"无"}`,t?"候选日逐日:":"逐日排序:",...n,...t?[`比较口径:${e.compare.note}`]:[],`神煞依据:${e.shenshaRef.text};起法 ${e.shenshaRef.volumes.join("、")}。未实现起法:${e.shenshaRef.unsupported.join("、")}(不计分,逐日 shensha.unsupported 列出)。`,...e.shenshaRef.juan10?[`卷十依据:${e.shenshaRef.juan10.text}(${e.shenshaRef.juan10.corpusLines});${e.shenshaRef.juan10.thresholdsNote}`]:[],`口径:${e.meta.scope}`].join(`
103
103
  `)}function lt(e){const t=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}):${t.text||"—"}`,`释义:${t.plain||"—"}`,`分档白话:${e.verdict.text}`,"口径:骨重与歌诀为通行本口径(各版本歌诀有异文),释义为白话自撰,属民俗娱乐参考。"].join(`
104
104
  `)}function ct(e){const t=e.question||e.meta&&e.meta.question||null;return[`【小六壬·${e.meta.mode}】${t?`所问:${t}`:""}`,e.meta.originText,`落宫:${e.steps.join(" → ")}`,`断语:${e.result.palace}(${e.result.luck}) ${e.result.text}`].join(`
105
- `)}function dt(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(t=>`· ${t.name}:${"★".repeat(t.stars)}${"☆".repeat(5-t.stars)} ${t.text}`).join(`
105
+ `)}function ht(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(t=>`· ${t.name}:${"★".repeat(t.stars)}${"☆".repeat(5-t.stars)} ${t.text}`).join(`
106
106
  `),`幸运色:${e.daily.luckyColor} 幸运数字:${e.daily.luckyNumber}`,"口径:当日基调由日期哈希确定性生成(同日同结果),纯娱乐向。"].join(`
107
- `)}function ht(e){const t=e.ganzhi;return[`【公农历转换·${e.meta.mode==="lunar2solar"?"农历 → 公历":"公历 → 农历"}】${e.lunar.text} ⇄ ${e.solar.text} ${e.meta.weekday}`,`干支:${t.year}年 ${t.month}月 ${t.day}日 属${t.shengXiao}${t.springYear&&t.springYear!==t.year?`(春节界为${t.springYear}年)`:""}`,...e.meta.note?[`注:${e.meta.note}`]:[],`口径:${e.meta.scope}`].join(`
107
+ `)}function dt(e){const t=e.ganzhi;return[`【公农历转换·${e.meta.mode==="lunar2solar"?"农历 → 公历":"公历 → 农历"}】${e.lunar.text} ⇄ ${e.solar.text} ${e.meta.weekday}`,`干支:${t.year}年 ${t.month}月 ${t.day}日 属${t.shengXiao}${t.springYear&&t.springYear!==t.year?`(春节界为${t.springYear}年)`:""}`,...e.meta.note?[`注:${e.meta.note}`]:[],`口径:${e.meta.scope}`].join(`
108
108
  `)}function mt(e){return[`【生命数字】${e.meta.date}(西方数字学,与八字/紫微不可互证)`,...e.parts.map(t=>`${t.name}:${t.number}(${t.meaning.title}) ${t.meaning.keywords}
109
109
   倾向:${t.meaning.tendency}
110
110
   课题:${t.meaning.lesson}`)].join(`
111
- `)}function ft(e){const t=[];return t.push(`太乙积年 ${e.meta.jinian},残年 ${e.meta.rest360},${e.meta.dunText}${e.meta.ju}局。`),t.push(`${e.year.jiName}${e.year.jiYear}年,${e.year.yuanName}第${e.year.yuanYear}年。`),t.push(`太乙在${e.taiyi.palaceName}宫(第${e.taiyi.palace}宫,${e.taiyi.dir}),第${e.taiyi.yearInPalace}年,${e.taiyi.li}。`),t.push(`八门:${e.gate.gate}。`),t.push(`文昌在${e.wenchang.pos}(${e.wenchang.god},${e.wenchang.palaceName}宫)。`),t.push(`这一层只算到太乙、八门、文昌三个落点;${e.scope.notCovered.join("、")}。`),t.join(`
112
- `)}function $t(e){const t=[];t.push(`【运气年】${e.year.ganzhi} ${e.year.nian} 年(大寒界:${e.year.startTime} — ${e.year.endTime})`),t.push(`【中运】${e.zhongyun.text}`),t.push(`【司天在泉】${e.sitian.qi}司天 ${e.zaiquan.qi}在泉`),t.push(`【当前】${e.current.text}`),t.push("【客运五步】");for(const n of e.keYun)t.push(` ${n.no} ${n.name}(${n.taiShao}) ${n.startTime} — ${n.endTime}`);t.push("【客气六步】");for(const n of e.keQi){const l=n.sitian?"(司天)":n.zaiquan?"(在泉)":"";t.push(` ${n.no} ${n.qi}${l} ${n.startTime} — ${n.endTime}`)}const i=[];return e.special.taiYi&&i.push("太乙天符"),e.special.tianFu&&!e.special.taiYi&&i.push("天符"),e.special.suiHui&&!e.special.taiYi&&i.push("岁会"),e.special.tongTianFu&&i.push("同天符"),e.special.tongSuiHui&&i.push("同岁会"),i.length&&t.push(`【特殊】${i.join("、")}`),t.push(`【组合】${e.combo.text}`),t.push(`【边界】${e.scope.note}`),t.join(`
111
+ `)}function ft(e){const t=[];t.push(`太乙积年 ${e.meta.jinian},残年 ${e.meta.rest360},${e.meta.dunText}${e.meta.ju}局。`),t.push(`${e.year.jiName}${e.year.jiYear}年,${e.year.yuanName}第${e.year.yuanYear}年。`),t.push(`太乙在${e.taiyi.palaceName}宫(第${e.taiyi.palace}宫,${e.taiyi.dir}),第${e.taiyi.yearInPalace}年,${e.taiyi.li}。`),t.push(`八门:${e.gate.gate}。`),t.push(`文昌在${e.wenchang.pos}(${e.wenchang.god},${e.wenchang.palaceName}宫)。`),t.push(`计神在${e.jishen.branch}(${e.jishen.god}),始击在${e.shiji.pos}(${e.shiji.god},${e.shiji.palaceName}宫)。`),t.push(`主算 ${e.suan.zhu}:主大将${e.jiang.zhuDaName}宫、主参将${e.jiang.zhuCanName}宫;客算 ${e.suan.ke}:客大将${e.jiang.keDaName}宫、客参将${e.jiang.keCanName}宫。`),t.push(e.geju.list.length?`格局:${e.geju.list.join(";")}。`:"四将之间不相犯,没有掩、迫、囚、格、关。"),t.push(`定目在${e.dingmu.pos}(${e.dingmu.god},${e.dingmu.palaceName}宫)。`),t.push(`三基:君基${e.sanji.jun}、臣基${e.sanji.chen}、民基${e.sanji.min};五福在${e.wufu.palaceName}宫,大游在${e.dayou.palaceName}宫。`),t.push(`十精:天乙${e.shijing.tianyi}、地乙${e.shijing.diyi}、直符${e.shijing.zhifu}、四神${e.shijing.sishen}、小游${e.shijing.xiaoyou}。`),t.push(`数和-主算:${e.heshu.zhu.text} 客算:${e.heshu.ke.text}`);const a=e.shenjiang||{};if(a.rows){const n=a.goods&&a.goods.length?a.goods.join("、"):"无",l=a.bads&&a.bads.length?a.bads.join("、"):"无";t.push(`神将:${a.stem}日(${a.day?"昼贵":"夜贵"})起${a.startBranch}、${a.dir>0?"顺":"逆"}行;在吉神下的有 ${n};在凶神下的有 ${l}。`)}return e.verdict&&t.push(`判辞:${e.verdict.label}。`),t.push(`月计:太乙在${e.month.taiyi.palaceName}宫(第${e.month.taiyi.unitInPalace}月),天目${e.month.mu.pos}(${e.month.mu.god}),计神在${e.month.jishen.branch}。`),t.push(`日计:太乙在${e.day.taiyi.palaceName}宫(第${e.day.taiyi.unitInPalace}日),天目${e.day.mu.pos}(${e.day.mu.god}),计神在${e.day.jishen.branch}。`),t.push(`时计:太乙在${e.hour.taiyi.palaceName}宫(第${e.hour.taiyi.unitInPalace}时),计神在${e.hour.jishen.branch}。${e.hour.note}`),t.push(`卦象:${e.jixiong.label}——${e.jixiong.text}`),t.push(`这一层到太乙、八门、文昌、计神、始击、主客算与四将、八种格局、定目、三基、五福、大游、十精、阴阳数和、月日时三计与古法吉凶;${e.scope.notCovered.join("、")}未收录。`),t.join(`
112
+ `)}function $t(e){const t=[];t.push(`【运气年】${e.year.ganzhi} ${e.year.nian} 年(大寒界:${e.year.startTime} — ${e.year.endTime})`),t.push(`【中运】${e.zhongyun.text}`),t.push(`【司天在泉】${e.sitian.qi}司天 ${e.zaiquan.qi}在泉`),t.push(`【当前】${e.current.text}`),t.push("【客运五步】");for(const n of e.keYun)t.push(` ${n.no} ${n.name}(${n.taiShao}) ${n.startTime} — ${n.endTime}`);t.push("【客气六步】");for(const n of e.keQi){const l=n.sitian?"(司天)":n.zaiquan?"(在泉)":"";t.push(` ${n.no} ${n.qi}${l} ${n.startTime} — ${n.endTime}`)}const a=[];return e.special.taiYi&&a.push("太乙天符"),e.special.tianFu&&!e.special.taiYi&&a.push("天符"),e.special.suiHui&&!e.special.taiYi&&a.push("岁会"),e.special.tongTianFu&&a.push("同天符"),e.special.tongSuiHui&&a.push("同岁会"),a.length&&t.push(`【特殊】${a.join("、")}`),t.push(`【组合】${e.combo.text}`),t.push(`【边界】${e.scope.note}`),t.join(`
113
113
  `)}function yt(e){return[`【中医体质】${e.primary.name}(主)${e.primary.level==="是"?"":`·${e.primary.level}`} 转化分 ${e.primary.converted}`,e.secondary?`兼夹:${e.secondary.name}(${e.secondary.converted})${e.mingled.length?";同判为「是」:"+e.mingled.join("、"):""}`:"","九种体质转化分(偏颇质 ≥40 判是、30–39 有倾向):",e.scales.map(t=>`· ${t.name}:${t.converted}${t.level==="否"?"":`(${t.level})`}`).join(`
114
114
  `),e.primary.oneLine,e.primary.tendency,"调养方向:",e.care.map(t=>"· "+t).join(`
115
115
  `),e.note].filter(Boolean).join(`
116
116
  `)}function pt(e){return[`【中医体质·问卷】${e.scaleCount} 种体质 × ${e.itemsPerScale} 题,共 ${e.total} 题`,"打分:"+e.scale.map(t=>`${t.v}=${t.label}`).join(" "),e.howto,e.note].join(`
117
- `)}function gt(e){const t=e.dims.map(r=>{const p=r.picked===r.left?r.leftSay:r.rightSay,w=Math.round(r.pct*100);return`${r.left}/${r.right} 取 ${r.picked}(${r.strength} ${w}%,净分 ${r.sum}) ${p}`}),i=e.profile,n=Array.isArray(i.stack)&&i.stack.length?i.stack.map((r,p)=>`${p===0?"主导 ":""}${r.code}`).join(" → ")+`
118
-  ${i.stack.map(r=>`${r.code}:${r.say}`).join(`
119
-  `)}`:"",l=Array.isArray(e.unanswered)&&e.unanswered.length?` 未答维度:${e.unanswered.join("、")}(该维按平手占位)`:"";return[`【十六型人格】${e.type}(${i.title})· ${i.keywords} 已答 ${e.answered}/${e.total} 题${l}`,`一句:${i.oneLine}`,"【四维】",...t,`【优势】${i.strengths.join(";")}`,`【留意】${i.blindspots.join(";")}`,`【课题】${i.growth}`,`【认知功能】${n}`,`【工作】${i.work}`,`【关系】${i.love}`,`【学习】${i.study}`,`注:${e.note}`].join(`
117
+ `)}function gt(e){const t=e.dims.map(r=>{const p=r.picked===r.left?r.leftSay:r.rightSay,w=Math.round(r.pct*100);return`${r.left}/${r.right} 取 ${r.picked}(${r.strength} ${w}%,净分 ${r.sum}) ${p}`}),a=e.profile,n=Array.isArray(a.stack)&&a.stack.length?a.stack.map((r,p)=>`${p===0?"主导 ":""}${r.code}`).join(" → ")+`
118
+  ${a.stack.map(r=>`${r.code}:${r.say}`).join(`
119
+  `)}`:"",l=Array.isArray(e.unanswered)&&e.unanswered.length?` 未答维度:${e.unanswered.join("、")}(该维按平手占位)`:"";return[`【十六型人格】${e.type}(${a.title})· ${a.keywords} 已答 ${e.answered}/${e.total} 题${l}`,`一句:${a.oneLine}`,"【四维】",...t,`【优势】${a.strengths.join(";")}`,`【留意】${a.blindspots.join(";")}`,`【课题】${a.growth}`,`【认知功能】${n}`,`【工作】${a.work}`,`【关系】${a.love}`,`【学习】${a.study}`,`注:${e.note}`].join(`
120
120
  `)}function bt(e){return[`【十六型人格问卷】${e.total} 题,每题按 1(完全不像我)到 5(很像我)打分`,...e.questions.map(t=>`${t.no}. ${t.text}`),`请把 ${e.total} 个分数按顺序交给 answers(如 [4,2,5,3,…]);可以跳过某些题(填 null),至少答 12 题。`,`注:${e.note}`].join(`
121
- `)}function wt(e){const t=e.meta.strength,i=e.meta.dayMaster,n=i&&typeof i=="object"?`${i.stem}(${i.element})`:String(i||"");return[`【人生 K 线】${e.meta.birth} ${e.meta.gender} 日主 ${n} 旺衰 ${t.level}(${t.score})`,e.meta.boundaryNote?`※ ${e.meta.boundaryNote}`:"",`【大运分段】${e.segments.map(l=>`${l.ganZhi} ${l.startAge}-${l.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?`
121
+ `)}function wt(e){const t=e.meta.strength,a=e.meta.dayMaster,n=a&&typeof a=="object"?`${a.stem}(${a.element})`:String(a||"");return[`【人生 K 线】${e.meta.birth} ${e.meta.gender} 日主 ${n} 旺衰 ${t.level}(${t.score})`,e.meta.boundaryNote?`※ ${e.meta.boundaryNote}`:"",`【大运分段】${e.segments.map(l=>`${l.ganZhi} ${l.startAge}-${l.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?`
122
122
  最需留意 ${e.highlights.worst.join(";")}`:""}`]:[],`※ ${e.disclaimer}`].filter(Boolean).join(`
123
- `)}function nn(e){if(e.meta.action==="xuankong"){const i=e.meta.period,n=V=>{const J=e.palaces.find(Z=>Z.palace===V);return`${V}${J.yun}/${J.shan}/${J.xiang}`},l=V=>V.map(n).join(" "),r=e.wangShanWangXiang,p=e.meta.jianXiang,w=e.timeFlying,E=w?`【年月日时】${[["year","年"],["month","月"],["day","日"],["hour","时"]].filter(([V])=>w[V]).map(([V,J])=>`${J}${w[V].centerName}${w[V].fly?`·${w[V].fly}`:""}`).join(" ")}${w.meta&&w.meta.note?`(${w.meta.note})`:""}`:"";return[`【玄空】${e.meta.periodLabel}${p&&p.active?"·替卦":"·下卦"} 坐 ${e.meta.sitting} 向 ${e.meta.facing}`,...p&&p.active?[`【替卦】${p.note}`]:[],`【入中】山盘 ${e.meta.shanCenter.star}${e.meta.shanCenter.name}(${e.meta.shanCenter.fly},${e.meta.shanCenter.basis}${e.meta.shanCenter.mode==="替卦"?`;原运星 ${e.meta.shanCenter.original}${e.meta.shanCenter.replaced?",已替":",用替而未替"}`:""});向盘 ${e.meta.xiangCenter.star}${e.meta.xiangCenter.name}(${e.meta.xiangCenter.fly},${e.meta.xiangCenter.basis}${e.meta.xiangCenter.mode==="替卦"?`;原运星 ${e.meta.xiangCenter.original}${e.meta.xiangCenter.replaced?",已替":",用替而未替"}`:""})`,`【九宫】${l(["巽","离","坤"])}|${l(["震","中","兑"])}|${l(["艮","坎","乾"])}`,`【当运】山星${i}到${e.dangYun.shan.text};向星${i}到${e.dangYun.xiang.text}`,`【表法】${r.byTable===null?"替卦不套正向表;":""}${r.table.length?r.table.join("、"):"无"};${r.note}`,`【合十】山星合十 ${e.heshi.shan.join("、")||"无"};向星合十 ${e.heshi.xiang.join("、")||"无"}`,...E?[E]:[],...e.meta.note?[`※ ${e.meta.note}`]:[],`※ ${e.disclaimer}`].join(`
124
- `)}if(e.meta.action==="advise"){const i=e.mingMatch?[`【命宅配】${e.mingMatch.text}`]:[`※ ${e.meta.birthNote||"未提供生辰,未做命宅配。"}`];return[`【宅卦】坐 ${e.meta.sitting} 向 ${e.meta.facing} ${e.meta.houseGua}宅(${e.meta.houseGroup})`,`【八星】${e.houseStars.map(n=>`${n.star}·${n.direction}${n.palace?`(${n.palace})`:""}`).join(" ")}`,`【门】${e.layout.door}`,`【灶】${e.layout.stove}`,`【床】${e.layout.bed}`,`【厕】${e.layout.toilet}`,...i,`※ ${e.disclaimer}`].join(`
125
- `)}const t=e.mingGua;return[`【命卦】${t.num}${t.gua}(${t.group}) 方位 ${t.direction}`,`【四吉】${e.luckyDirections.map(i=>`${i.star}·${i.direction}${i.palace?`(${i.palace})`:""}`).join(" ")}`,`【四凶】${e.unluckyDirections.map(i=>`${i.star}·${i.direction}`).join(" ")}`,...e.yearlyFlying?[`【${e.meta.fortuneYear} 年九宫飞星】中宫 ${e.yearlyFlying.centerName};${e.yearlyFlying.palaces.filter(i=>i.palace!=="中").map(i=>`${i.palace}${i.name}`).join(" ")}`]:[`※ ${e.meta.note||""}`],`※ ${e.disclaimer}`].filter(Boolean).join(`
126
- `)}function St(e){if(e.action==="generate")return[`【候选名】姓 ${e.surname}(${e.gender},喜用 ${e.bazi.favorable.join("、")})${e.bazi.basis}`,...e.candidates.map(w=>{const E=w.wuge&&w.wuge.available?` 五格 ${w.wuge.summary}`:"",V=w.phonetics&&w.phonetics.available?` 音韵 ${w.phonetics.level}(${w.phonetics.tonePattern})`:"";return`${w.rank}. ${w.name} ${w.chars.map(J=>`${J.char}(${J.element})${J.meaning}`).join(" ")}${E}${V}`}),...e.notes.map(w=>`※ ${w}`)].join(`
127
- `);const t=w=>w.source==="lib"?"字库":w.source==="user"?"用户指定":"未收录",i=w=>{const E=w.element==="未收录"?"未收录(不猜五行)":`${w.element}(${t(w)})`,V=w.favorable===!0?"合喜用":w.favorable===!1?"不合喜用":"不判",J=w.suggest&&w.suggest.length?` 可换:${w.suggest.map(Z=>`${Z.char}(${Z.element})`).join("、")}`:"";return`· ${w.char}:${E}|${V}|${w.meaning}${J}`},n=e.wuge,l=n&&n.available?`【五格】${n.strokes.map(w=>`${w.char}${w.strokes}画`).join("+")}|${n.summary}|三才 ${n.sancai.text}`:`【五格】${n?n.reason:"未算"}`,r=e.phonetics,p=r&&r.available?`【音韵】${r.chars.map(w=>`${w.char}${w.py}${w.tone}`).join(" ")}|声调 ${r.tonePattern}|${r.level}${(r.alt||[]).length?`|姓又读 ${r.alt.map(w=>`${w.char}${w.py}${w.tone}`).join("、")}`:""}${r.issues.length?`:${r.issues.map(w=>w.text).join(";")}`:""}`:`【音韵】${r?r.reason:"未算"}`;return[`【名字评估】${e.fullName}`,...e.chars.map(i),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}`:"",l,p,`【结论】${e.verdict}`,...e.notes.map(w=>`※ ${w}`)].filter(Boolean).join(`
128
- `)}function jt(e){const t=e.summary??JSON.stringify(e,null,2),i=`
129
- `,l=[(e.brief?["【先说结论】"+e.brief.lead].concat((e.brief.sections||[]).map(r=>[" ",r.h,":",r.t].join(""))).concat((e.brief.advice||[]).length?[" 可以试着做的:"+e.brief.advice.map(r=>String(r).replace(/。$/,"")).join(";")+"。"]:[]).concat(e.brief.caveat?[" ※ "+e.brief.caveat]:[]).join(i)+i:"")+t];if(e.shadow&&e.shadow.id){const r=e.shadow;l.push(`【影子盘】${r.id}(同参数同 ID;版本 ${r.version})
123
+ `)}function nn(e){if(e.meta.action==="xuankong"){const a=e.meta.period,n=ee=>{const W=e.palaces.find(Z=>Z.palace===ee);return`${ee}${W.yun}/${W.shan}/${W.xiang}`},l=ee=>ee.map(n).join(" "),r=e.wangShanWangXiang,p=e.meta.jianXiang,w=e.timeFlying,T=w?`【年月日时】${[["year","年"],["month","月"],["day","日"],["hour","时"]].filter(([ee])=>w[ee]).map(([ee,W])=>`${W}${w[ee].centerName}${w[ee].fly?`·${w[ee].fly}`:""}`).join(" ")}${w.meta&&w.meta.note?`(${w.meta.note})`:""}`:"";return[`【玄空】${e.meta.periodLabel}${p&&p.active?"·替卦":"·下卦"} 坐 ${e.meta.sitting} 向 ${e.meta.facing}`,...p&&p.active?[`【替卦】${p.note}`]:[],`【入中】山盘 ${e.meta.shanCenter.star}${e.meta.shanCenter.name}(${e.meta.shanCenter.fly},${e.meta.shanCenter.basis}${e.meta.shanCenter.mode==="替卦"?`;原运星 ${e.meta.shanCenter.original}${e.meta.shanCenter.replaced?",已替":",用替而未替"}`:""});向盘 ${e.meta.xiangCenter.star}${e.meta.xiangCenter.name}(${e.meta.xiangCenter.fly},${e.meta.xiangCenter.basis}${e.meta.xiangCenter.mode==="替卦"?`;原运星 ${e.meta.xiangCenter.original}${e.meta.xiangCenter.replaced?",已替":",用替而未替"}`:""})`,`【九宫】${l(["巽","离","坤"])}|${l(["震","中","兑"])}|${l(["艮","坎","乾"])}`,`【当运】山星${a}到${e.dangYun.shan.text};向星${a}到${e.dangYun.xiang.text}`,`【表法】${r.byTable===null?"替卦不套正向表;":""}${r.table.length?r.table.join("、"):"无"};${r.note}`,`【合十】山星合十 ${e.heshi.shan.join("、")||"无"};向星合十 ${e.heshi.xiang.join("、")||"无"}`,...T?[T]:[],...e.meta.note?[`※ ${e.meta.note}`]:[],`※ ${e.disclaimer}`].join(`
124
+ `)}if(e.meta.action==="advise"){const a=e.mingMatch?[`【命宅配】${e.mingMatch.text}`]:[`※ ${e.meta.birthNote||"未提供生辰,未做命宅配。"}`];return[`【宅卦】坐 ${e.meta.sitting} 向 ${e.meta.facing} ${e.meta.houseGua}宅(${e.meta.houseGroup})`,`【八星】${e.houseStars.map(n=>`${n.star}·${n.direction}${n.palace?`(${n.palace})`:""}`).join(" ")}`,`【门】${e.layout.door}`,`【灶】${e.layout.stove}`,`【床】${e.layout.bed}`,`【厕】${e.layout.toilet}`,...a,`※ ${e.disclaimer}`].join(`
125
+ `)}const t=e.mingGua;return[`【命卦】${t.num}${t.gua}(${t.group}) 方位 ${t.direction}`,`【四吉】${e.luckyDirections.map(a=>`${a.star}·${a.direction}${a.palace?`(${a.palace})`:""}`).join(" ")}`,`【四凶】${e.unluckyDirections.map(a=>`${a.star}·${a.direction}`).join(" ")}`,...e.yearlyFlying?[`【${e.meta.fortuneYear} 年九宫飞星】中宫 ${e.yearlyFlying.centerName};${e.yearlyFlying.palaces.filter(a=>a.palace!=="中").map(a=>`${a.palace}${a.name}`).join(" ")}`]:[`※ ${e.meta.note||""}`],`※ ${e.disclaimer}`].filter(Boolean).join(`
126
+ `)}function jt(e){if(e.action==="generate")return[`【候选名】姓 ${e.surname}(${e.gender},喜用 ${e.bazi.favorable.join("、")})${e.bazi.basis}`,...e.candidates.map(w=>{const T=w.wuge&&w.wuge.available?` 五格 ${w.wuge.summary}`:"",ee=w.phonetics&&w.phonetics.available?` 音韵 ${w.phonetics.level}(${w.phonetics.tonePattern})`:"";return`${w.rank}. ${w.name} ${w.chars.map(W=>`${W.char}(${W.element})${W.meaning}`).join(" ")}${T}${ee}`}),...e.notes.map(w=>`※ ${w}`)].join(`
127
+ `);const t=w=>w.source==="lib"?"字库":w.source==="user"?"用户指定":"未收录",a=w=>{const T=w.element==="未收录"?"未收录(不猜五行)":`${w.element}(${t(w)})`,ee=w.favorable===!0?"合喜用":w.favorable===!1?"不合喜用":"不判",W=w.suggest&&w.suggest.length?` 可换:${w.suggest.map(Z=>`${Z.char}(${Z.element})`).join("、")}`:"";return`· ${w.char}:${T}|${ee}|${w.meaning}${W}`},n=e.wuge,l=n&&n.available?`【五格】${n.strokes.map(w=>`${w.char}${w.strokes}画`).join("+")}|${n.summary}|三才 ${n.sancai.text}`:`【五格】${n?n.reason:"未算"}`,r=e.phonetics,p=r&&r.available?`【音韵】${r.chars.map(w=>`${w.char}${w.py}${w.tone}`).join(" ")}|声调 ${r.tonePattern}|${r.level}${(r.alt||[]).length?`|姓又读 ${r.alt.map(w=>`${w.char}${w.py}${w.tone}`).join("、")}`:""}${r.issues.length?`:${r.issues.map(w=>w.text).join(";")}`:""}`:`【音韵】${r?r.reason:"未算"}`;return[`【名字评估】${e.fullName}`,...e.chars.map(a),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}`:"",l,p,`【结论】${e.verdict}`,...e.notes.map(w=>`※ ${w}`)].filter(Boolean).join(`
128
+ `)}function St(e){const t=e.summary??JSON.stringify(e,null,2),a=`
129
+ `,l=[(e.brief?["【先说结论】"+e.brief.lead].concat((e.brief.sections||[]).map(r=>[" ",r.h,":",r.t].join(""))).concat((e.brief.advice||[]).length?[" 可以试着做的:"+e.brief.advice.map(r=>String(r).replace(/。$/,"")).join(";")+"。"]:[]).concat(e.brief.caveat?[" ※ "+e.brief.caveat]:[]).join(a)+a:"")+t];if(e.shadow&&e.shadow.id){const r=e.shadow;l.push(`【影子盘】${r.id}(同参数同 ID;版本 ${r.version})
130
130
   基础指纹 ${r.baseId}(不含版本,跨版本可比对)`+(r.reproducible===!1?`
131
131
   ⚠ 不可复算:${r.reason}`:"")+(r.reproducible===!0&&r.asOfPinned===!1&&(r.system==="bazi"||r.system==="ziwei")?`
132
132
   提示:未固定 asOf,流年/流月随「此刻」变化;要比对请传 asOf。`:""))}if(e.revision&&((e.revision.applied||[]).length||(e.revision.ignored||[]).length)){const r=e.revision,p=(r.applied||[]).map(w=>`${w.label}:${w.fromDisplay==null?"(未设)":w.fromDisplay} → ${w.display}`);l.push(`【改参】${r.text}${p.length?`
133
133
   ${p.join(";")}`:`
134
134
   没有识别到可改的参数,仍按原参数排盘`}`+((r.ignored||[]).length?`
135
135
   未处理:${r.ignored.join(";")}`:""))}if(typeof e.handle=="string"&&e.handle&&l.push(`【排盘句柄】${e.handle}
136
-  追问同一张盘:传 handle + 增量参数(asOf / direction / question,或换 system 看另一套盘),不必重报出生信息。`),Array.isArray(e.trace)&&e.trace.length&&l.push(`【推导链】${On[e.system]||e.system} · ${e.trace.length} 层
136
+  追问同一张盘:传 handle + 增量参数(asOf / direction / question,或换 system 看另一套盘),不必重报出生信息。`),Array.isArray(e.trace)&&e.trace.length&&l.push(`【推导链】${vn[e.system]||e.system} · ${e.trace.length} 层
137
137
  `+e.trace.map((r,p)=>`${p+1}. ${r.field}|${r.result}
138
138
   规则:${r.rule} 出处:${r.source}`).join(`
139
- `)),e.interpret){const r=Sn(e.interpret,e.interpretTier);r&&l.push(r)}if(e.cross&&l.push(`【八字 × 紫微 交叉验证】
139
+ `)),e.interpret){const r=jn(e.interpret,e.interpretTier);r&&l.push(r)}if(e.cross&&l.push(`【八字 × 紫微 交叉验证】
140
140
  ${ye(e.cross)}`),e.caliber&&Array.isArray(e.caliber.switches)&&e.caliber.switches.length){const r=e.caliber;l.push(`【口径对照】同一组输入,只换一个口径(不判哪套更准,也不改盘面)
141
- `+r.switches.map(p=>{if(p.error)return`· ${p.title}:未能对照(${p.error})`;if(!p.total)return`· ${p.title}:${p.currentLabel} → ${p.altLabel},本盘无变化`;const w=(Array.isArray(p.views)?p.views:[]).filter(V=>V.changed),E=w.length?`
142
-  并排:${w.map(V=>`${V.label} ${V.current} → ${V.alt}`).join(";")}`:"";return`· ${p.title}:${p.currentLabel} → ${p.altLabel}
143
-  ${p.summary}${E}`}).join(`
141
+ `+r.switches.map(p=>{if(p.error)return`· ${p.title}:未能对照(${p.error})`;if(!p.total)return`· ${p.title}:${p.currentLabel} → ${p.altLabel},本盘无变化`;const w=(Array.isArray(p.views)?p.views:[]).filter(ee=>ee.changed),T=w.length?`
142
+  并排:${w.map(ee=>`${ee.label} ${ee.current} → ${ee.alt}`).join(";")}`:"";return`· ${p.title}:${p.currentLabel} → ${p.altLabel}
143
+  ${p.summary}${T}`}).join(`
144
144
  `))}if(e.followup){const r=e.followup;l.push(`【追问】${r.question}
145
145
  ${r.answer}${r.evidence&&r.evidence.length?`
146
146
   依据:${r.evidence.join(";")} 置信度:${r.confidence}`:""}`)}if(e.past&&Array.isArray(e.past.rows)&&e.past.rows.length&&l.push(`【验前事】过去 ${e.past.years} 年的流年信号(只读,不改盘)
@@ -151,4 +151,4 @@ ${r.answer}${r.evidence&&r.evidence.length?`
151
151
  `)+`
152
152
  ${r.note}`)}return l.filter(Boolean).join(`
153
153
 
154
- `)}const{buildEventPrompt:xt,ASK_KINDS:kt}=R["event-prompt"]||{},{plainSummary:zt}=R["plain-summary"]||{};return{interpret:U,DIRECTIONS:ce,DIRECTION_DEFAULT:le,BRIGHTNESS:_,flowOf:A,parseDateTime:fe,geocodeAddress:x,resolveAddress:M,buildBazi:P,buildLiuyao:B,tossLines:F,followup:be,askPrompt:Ne,pastSignals:Ze,verifyFit:Je,rectifyBirth:Ye,crossCheck:te,crossText:ye,crossSection:Ke,buildAlmanac:De,buildZeri:Ie,buildChenggu:Pe,buildXiaoliuren:Ae,buildStar:Ee,buildNumerology:Ce,buildConvert:Re,buildTrend:dn,buildFengshui:He,buildName:hn,buildConstitution:we,buildWuyunliuqi:Te,buildTaiyi:_e,buildTrace:mn,traceMarkdown:fn,encodeHandle:a,decodeHandle:b,resolveHandle:D,pruneForeignKeys:ee,ownedKeys:S,askLink:T,parseAskLink:L,formOf:K,restNote:Q,askPackages:oe,buildEventPrompt:xt,ASK_KINDS:kt,chartFingerprint:bn,shadowSnapshot:Qn,shadowDiff:Vn,compute:Ve,interpretText:Sn,caliberCompare:nt,normalizeLongitudes:jn,renderText:jt}})(),{Engine:R.index}}});
154
+ `)}const{buildEventPrompt:xt,ASK_KINDS:kt}=R["event-prompt"]||{},{plainSummary:zt}=R["plain-summary"]||{};return{interpret:U,DIRECTIONS:ce,DIRECTION_DEFAULT:le,BRIGHTNESS:L,flowOf:A,parseDateTime:fe,geocodeAddress:x,resolveAddress:M,buildBazi:P,buildLiuyao:B,tossLines:F,followup:be,askPrompt:Ne,pastSignals:Ze,verifyFit:Je,rectifyBirth:De,crossCheck:te,crossText:ye,crossSection:Ke,buildAlmanac:Ye,buildZeri:Ie,buildChenggu:Pe,buildXiaoliuren:Ae,buildStar:Ee,buildNumerology:Ce,buildConvert:Re,buildTrend:hn,buildFengshui:He,buildName:dn,buildConstitution:we,buildWuyunliuqi:Te,buildTaiyi:_e,buildTrace:mn,traceMarkdown:fn,encodeHandle:i,decodeHandle:b,resolveHandle:Y,pruneForeignKeys:K,ownedKeys:j,askLink:E,parseAskLink:_,formOf:J,restNote:V,askPackages:oe,buildEventPrompt:xt,ASK_KINDS:kt,chartFingerprint:bn,shadowSnapshot:Qn,shadowDiff:Vn,compute:Ve,interpretText:jn,caliberCompare:nt,normalizeLongitudes:Sn,renderText:St}})(),{Engine:R.index}}});