PageSourceSearch

https://baibaoshu.net/assets/FootprintZen-BPziRES9.js

js baibaoshu.net collected 2026-09-25 03:38:39 UTC 15,030 bytes, 1 lines download raw bytes

1import{ah as e,a3 as t}from"./vendor-misc-DBewy47e.js";import{dG as s,dl as a,eu as n,f$ as r,ah as i,c5 as l,du as o,dX as c,B as d,gP as u,ed as p,eh as g,S as x}from"./index-BgmH_Ksq.js";import{g as m}from"./libraryReadingProgress-CTln7F6i.js";import{e as h,bt as f,s as b,F as y,aM as k,bg as j,by as w}from"./vendor-icons-j3vl9R2U.js";import"./vendor-supabase-DCTo4nxi.js";import"./chinese-language-CLYDn-o3.js";import"./vendor-i18n-DMY_791a.js";const N=new Map(d.map(e=>[e.name,e])),v={task:"读完一段",chapter:"读经文",challenge:"做挑战",journal:"写灵修笔记",week:"通关一周"},_=new Set(["reading","study","route"]);async function D(e){const t=1e3;let s=0;const a=[];for(;;){const{data:n,error:r}=await e(s,s+t-1);if(r||!n||0===n.length)break;if(a.push(...n),n.length<t)break;s+=t}return a}function S(e){if(null==e)return null;let t;if("number"==typeof e)t=new Date(e);else if("string"==typeof e&&/^\d+$/.test(e.trim()))t=new Date(Number(e.trim()));else{const s=String(e).trim().replace(" ","T").replace(/(\.\d{3})\d+/,"$1").replace(/([+-]\d{2})(\d{2})?$/,(e,t,s)=>`${t}:${s||"00"}`);t=new Date(s)}return Number.isNaN(t.getTime())?null:c(t)}const q={fontFamily:'"Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif'},z=["quiz","study","reading","library","geography"],F=e=>x[e].tone;function A(e){if(!e)return[];const t=[];return e.quiz&&e.quiz.questions>0&&t.push("quiz"),e.wiki&&e.wiki.length&&t.push("study"),e.reading&&t.push("reading"),e.articles&&e.articles.length&&t.push("library"),e.geography&&e.geography.length&&t.push("geography"),t}function C(e,t,s){if(e===t)return s("今天");const[,a,n]=e.split("-");return s("{0}月{1}日").replace("{0}",String(Number(a))).replace("{1}",String(Number(n)))}const E=({data:e,tc:s})=>{const a=[];if((null==e?void 0:e.wiki)&&e.wiki.length){const n=e.wiki.map(e=>s("《{0}》{1}章").replace("{0}",e.book).replace("{1}",String(e.chapter))).join("、");a.push(t.jsxs($,{tone:"#B85138",bg:"#FBEDE7",icon:t.jsx(b,{className:"w-[15px] h-[15px]",strokeWidth:1.7}),children:[t.jsx("span",{className:"text-slate-500 dark:text-stone-400",children:s("研读了")})," ",n]},"wiki"))}if(null==e?void 0:e.reading){const n=e.reading.weeks.sort((e,t)=>e-t),r=n.length?s("通读 · 第 {0} 周").replace("{0}",n.join("、")):s("通读打卡"),i=(e.reading.sources||[]).map(e=>v[e]).filter(Boolean).map(e=>s(e));a.push(t.jsxs($,{tone:"#1E5C9A",bg:"#E4EFFA",icon:t.jsx(y,{className:"w-[15px] h-[15px]",strokeWidth:1.7}),children:[r,i.length>0&&t.jsxs("span",{className:"text-slate-500 dark:text-stone-400",children:[" · ",i.join(" · ")]})]},"reading"))}return(null==e?void 0:e.quiz)&&e.quiz.questions>0&&a.push(t.jsxs($,{tone:"#3D7340",bg:"#E6F1DD",icon:t.jsx(k,{className:"w-[15px] h-[15px]",strokeWidth:1.7}),children:[s("做了 {0} 题").replace("{0}",String(e.quiz.questions)),t.jsxs("span",{className:"text-slate-500 dark:text-stone-400",children:[" · ",s("对 {0}").replace("{0}",String(e.quiz.correct))]})]},"quiz")),(null==e?void 0:e.articles)&&e.articles.length&&a.push(t.jsxs($,{tone:"#5A3A8C",bg:"#EFE7FA",icon:t.jsx(j,{className:"w-[15px] h-[15px]",strokeWidth:1.7}),children:[t.jsx("span",{className:"text-slate-500 dark:text-stone-400",children:s("读了")}),t.jsx("span",{className:"inline-flex flex-wrap gap-x-1 gap-y-0.5 align-top",children:e.articles.map(e=>t.jsx("button",{type:"button",onClick:()=>g("libraryArticle",{librarySlug:e.slug}),className:"text-[#5A3A8C] dark:text-violet-300 hover:underline inline-flex items-center",children:s("《{0}》").replace("{0}",e.title)},e.slug))})]},"articles")),(null==e?void 0:e.geography)&&e.geography.length&&a.push(t.jsxs($,{tone:"#1F6E8C",bg:"#DDF2F7",icon:t.jsx(w,{className:"w-[15px] h-[15px]",strokeWidth:1.7}),children:[t.jsx("span",{className:"text-slate-500 dark:text-stone-400",children:s("看过了")}),t.jsx("span",{className:"inline-flex flex-wrap gap-x-1 gap-y-0.5 align-top",children:e.geography.map(e=>t.jsx("button",{type:"button",onClick:()=>g("geography",{geoPlace:e.placeId}),className:"text-[#1F6E8C] dark:text-cyan-300 hover:underline inline-flex items-center",children:s("《{0}》").replace("{0}",e.name)},e.placeId))})]},"geography")),0===a.length?t.jsx("p",{className:"text-[13px] text-slate-500 dark:text-stone-400 text-center py-6",children:s("这一天还没有留下记录")}):t.jsx("div",{className:"flex flex-col gap-2.5",children:a})},$=({tone:e,bg:s,icon:a,children:n})=>t.jsxs("div",{className:"flex items-start gap-2.5",children:[t.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full flex items-center justify-center mt-[1px]",style:{background:s,color:e},children:a}),t.jsx("p",{className:"text-[14px] leading-relaxed text-slate-700 dark:text-stone-200 m-0 flex-1 min-w-0",children:n})]}),B=({user:d,onBack:b})=>{const y=u(),[k,j]=e.useState(null),[w,v]=e.useState(!!d),[$,B]=e.useState(""),P=c(new Date),W=e.useMemo(()=>{const e=p(new Date),t=new Date(e);return t.setDate(t.getDate()-357),c(t)},[]);e.useEffect(()=>{if(!d)return;let e=!0;return v(!0),(async()=>{const t=await async function(e,t){if(!e||!s()||!a())return{byDay:{},activeDays:0,totals:{quizQuestions:0,wikiChapters:0,readingDays:0,articles:0,geoPlaces:0}};const c=n(t).getTime(),d=new Date(c).toISOString();try{const[s,a,n,u,p]=await Promise.all([D((t,s)=>r.from("quiz_attempts").select("timestamp, total_questions, score").eq("user_id",e).gte("timestamp",c).order("id",{ascending:!0}).range(t,s)),D((t,s)=>r.from("bible_wiki_user_visited").select("book, chapter, visited_at").eq("user_id",e).gte("visited_at",d).order("book",{ascending:!0}).order("chapter",{ascending:!0}).range(t,s)),D((s,a)=>r.from("bible_reading_checkins").select("day, sources, task_refs").eq("user_id",e).gte("day",t).order("day",{ascending:!0}).range(s,a)),D((t,s)=>r.from("article_reading_progress").select("article_id, updated_at").eq("user_id",e).gte("updated_at",d).order("article_id",{ascending:!0}).range(t,s)),D((t,s)=>r.from("user_geo_place_visits").select("place_id, last_seen_at, last_source").eq("user_id",e).gte("last_seen_at",d).order("place_id",{ascending:!0}).range(t,s))]),g={},x=e=>g[e]||(g[e]={day:e});let h=0;for(const e of s){const s=S(e.timestamp);if(!s||s<t)continue;const a=x(s),n=a.quiz||(a.quiz={questions:0,correct:0}),r=Number(e.total_questions)||0;n.questions+=r,n.correct+=Number(e.score)||0,h+=r}const f=new Set;for(const e of a){const s=S(e.visited_at);if(!s||s<t)continue;const a=N.get(String(e.book)),n=a?i(a):String(e.book),r=Number(e.chapter)||0,l=x(s);(l.wiki||(l.wiki=[])).push({book:n,chapter:r}),f.add(`${e.book}:${e.chapter}`)}const b=new Set;for(const e of n){const s=String(e.day);if(s<t)continue;b.add(s);
1const a=x(s),n=a.reading||(a.reading={weeks:[],sources:[]});for(const t of Array.isArray(e.sources)?e.sources:[])"string"!=typeof t||n.sources.includes(t)||n.sources.push(t);for(const t of Array.isArray(e.task_refs)?e.task_refs:[]){const e=Number(null==t?void 0:t.weekNum);Number.isFinite(e)&&e>0&&!n.weeks.includes(e)&&n.weeks.push(e)}}const y=u.filter(e=>{const s=S(e.updated_at);return!!s&&s>=t}),k=m(c),j=Array.from(new Set(y.map(e=>String(e.article_id)))),w=Array.from(new Set(k.map(e=>e.slug).filter(Boolean))),v={},q={};if(j.length){const e=await D((e,t)=>r.from("articles").select("id, title, slug").in("id",j).order("id",{ascending:!0}).range(e,t));for(const t of e){const e={title:t.title||t.slug||"",slug:t.slug||""};v[String(t.id)]=e,e.slug&&(q[e.slug]=e)}}if(w.length){const e=await D((e,t)=>r.from("articles").select("id, title, slug").in("slug",w).order("id",{ascending:!0}).range(e,t));for(const t of e){const e={title:t.title||t.slug||"",slug:t.slug||""};e.slug&&(q[e.slug]=e)}}const z=new Set,F=(e,t)=>{if(!t.slug)return;const s=x(e),a=s.articles||(s.articles=[]);a.some(e=>e.slug===t.slug)||a.push(t),z.add(t.slug)};for(const e of y){const s=S(e.updated_at);if(!s||s<t)continue;const a=v[String(e.article_id)];a&&a.slug&&F(s,a)}for(const e of k){const s=S(e.ts);!s||s<t||F(s,q[e.slug]||{title:e.slug,slug:e.slug})}const A=p.filter(e=>!_.has(String(e.last_source||""))),C=Array.from(new Set(A.map(e=>String(e.place_id)).filter(Boolean))),E={};if(C.length){const e=l(),t=await D((e,t)=>r.from("geo_places").select("id, name_zh, name_en").in("id",C).order("id",{ascending:!0}).range(e,t));for(const s of t)E[String(s.id)]=o(e)?s.name_zh||s.name_en||s.id:s.name_en||s.name_zh||s.id}const $=new Set;for(const e of A){const s=S(e.last_seen_at);if(!s||s<t)continue;const a=String(e.place_id),n=x(s),r=n.geography||(n.geography=[]);r.some(e=>e.placeId===a)||r.push({placeId:a,name:E[a]||a}),$.add(a)}return{byDay:g,activeDays:Object.keys(g).length,totals:{quizQuestions:h,wikiChapters:f.size,readingDays:b.size,articles:z.size,geoPlaces:$.size}}}catch{return{byDay:{},activeDays:0,totals:{quizQuestions:0,wikiChapters:0,readingDays:0,articles:0,geoPlaces:0}}}}(d.id,W);if(!e)return;j(t);const c=Object.keys(t.byDay).sort();B(c.length?c[c.length-1]:P),v(!1)})(),()=>{e=!1}},[null==d?void 0:d.id,W]);const{weeks:M,monthLabels:Q}=e.useMemo(()=>function(e){const t=new Date,s=c(t),a=p(t),n=new Date(a);n.setDate(n.getDate()-357);const r=[],i=[];let l=-1;for(let o=0;o<52;o++){const t=[];for(let r=0;r<7;r++){const a=new Date(n);a.setDate(a.getDate()+7*o+r);const i=c(a);t.push({day:i,mods:A(e[i]),future:i>s})}const a=new Date(n);a.setDate(a.getDate()+7*o),a.getMonth()!==l&&(l=a.getMonth(),i.push({index:o,label:`${l+1}`})),r.push(t)}return{weeks:r,monthLabels:i}}((null==k?void 0:k.byDay)||{}),[k]),I=null==k?void 0:k.totals;return t.jsxs("div",{className:"min-h-screen flex flex-col dark:bg-[#242019]",style:{background:"var(--paper, #FAF9F6)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[t.jsxs("header",{className:"sticky top-0 z-30 px-4 pt-2 pb-0 max-w-3xl mx-auto w-full flex items-center min-h-[40px]",style:{background:"var(--paper, #FAF9F6)",paddingTop:"calc(0.5rem + env(safe-area-inset-top, 0px))"},children:[t.jsxs("button",{type:"button",onClick:()=>b?b():g("dashboard"),"aria-label":y("返回"),className:"inline-flex items-center gap-1.5 text-[14px] text-slate-500 dark:text-stone-400 hover:text-slate-800 transition-colors px-2 py-1 -ml-2",style:q,children:[t.jsx(h,{className:"w-4 h-4",strokeWidth:1.6}),y("返回")]}),t.jsx("h1",{className:"absolute left-1/2 -translate-x-1/2 text-[15px] font-medium text-slate-800 dark:text-stone-100 tracking-[0.16em]",style:q,children:y("圣经学习足迹")})]}),t.jsx("div",{className:"flex-1 max-w-3xl mx-auto w-full px-4 pt-4 pb-16",style:q,children:d?t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"text-center text-[14px] text-slate-500 dark:text-stone-400 leading-relaxed mb-4 px-2",children:[y("你的话是我脚前的灯,是我路上的光。"),t.jsx("span",{className:"block text-[13px] mt-0.5",children:y("——诗篇 119:105")})]}),w?t.jsx("p",{className:"text-center text-[13px] text-slate-500 dark:text-stone-400 py-16",children:y("正在整理你的脚踪…")}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"text-center mb-5",children:[t.jsx("p",{className:"text-[15px] text-slate-700 dark:text-stone-200 m-0",children:(()=>{const e=y("这一年,上帝与你在祂话语里同行了 {0} 天").split("{0}");return t.jsxs(t.Fragment,{children:[e[0],t.jsx("span",{className:"text-amber-700 dark:text-amber-300 font-semibold",children:(null==k?void 0:k.activeDays)??0}),e[1]??""]})})()}),I&&I.wikiChapters+I.readingDays+I.quizQuestions+I.articles+I.geoPlaces>0&&t.jsx("p",{className:"text-[14px] text-slate-500 dark:text-stone-400 mt-1.5",children:[I.wikiChapters>0&&y("精读 {0} 章").replace("{0}",String(I.wikiChapters)),I.readingDays>0&&y("通读 {0} 天").replace("{0}",String(I.readingDays)),I.quizQuestions>0&&y("答题 {0} 道").replace("{0}",String(I.quizQuestions)),I.articles>0&&y("专栏 {0} 篇").replace("{0}",String(I.articles)),I.geoPlaces>0&&y("地名 {0} 处").replace("{0}
1",String(I.geoPlaces))].filter(Boolean).join("  ·  ")})]}),t.jsxs("div",{className:"bg-white/70 dark:bg-stone-800/40 rounded-2xl border border-stone-100 dark:border-stone-700/50 px-3 py-4 mb-4",children:[t.jsxs("div",{className:"overflow-x-auto pb-1",style:{WebkitOverflowScrolling:"touch"},children:[t.jsx("style",{children:"\n                      .fp-empty{background:#EFEAE0;}\n                      .fp-future{background:transparent;border:1px dashed #E6E2D6;}\n                      html.dark .fp-empty{background:#3A3733;}\n                      html.dark .fp-future{border-color:#44413B;}\n                    "}),t.jsx("div",{className:"flex text-[13px] text-slate-500 dark:text-stone-400 mb-1",style:{gap:3},children:M.map((e,s)=>{const a=Q.find(e=>e.index===s);return t.jsx("span",{style:{width:11},className:"whitespace-nowrap overflow-visible",children:a?a.label:""},s)})}),t.jsx("div",{className:"flex",style:{gap:3},children:M.map((e,s)=>t.jsx("div",{className:"flex flex-col",style:{gap:3},children:e.map(e=>{const s=e.day===$,a=e.day===P,n=function(e){if(0===e.length)return;if(1===e.length)return F(e[0]);const t=360/e.length;return`conic-gradient(from 0deg, ${e.map((e,s)=>`${F(e)} ${(s*t).toFixed(1)}deg ${((s+1)*t).toFixed(1)}deg`).join(", ")})`}(e.mods);return t.jsx("button",{type:"button",disabled:e.future,onClick:()=>B(e.day),title:e.future?"":e.day,className:`rounded-[3px] transition-transform ${e.future?"fp-future":n?"":"fp-empty"} ${s?"ring-2 ring-slate-700 dark:ring-stone-200 scale-110 relative z-10":a?"ring-1 ring-slate-400/70":""}`,style:{width:11,height:11,background:e.future?void 0:n}},e.day)})},s))})]}),t.jsx("div",{className:"flex items-center justify-center flex-wrap gap-x-3 gap-y-1 mt-3 text-[13px] text-slate-600 dark:text-stone-300",children:z.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx("span",{className:"rounded-[2px]",style:{width:10,height:10,background:F(e)}}),y(x[e].nameZh)]},e))}),t.jsx("p",{className:"text-center text-[13px] text-slate-500 dark:text-stone-400 mt-2",children:y("一天做了多种,格子按颜色拼起来")})]}),t.jsxs("div",{className:"bg-white dark:bg-stone-800/60 rounded-2xl border border-stone-100 dark:border-stone-700/50 px-4 py-4",children:[t.jsxs("p",{className:"text-[13px] font-medium text-slate-700 dark:text-stone-200 mb-3",children:[C($,P,y),t.jsx("span",{className:"text-slate-500 dark:text-stone-600",children:" · "}),t.jsx("span",{className:"text-[13px] text-slate-500 dark:text-stone-400 font-normal",children:y("这天的脚踪")})]}),t.jsx(E,{data:null==k?void 0:k.byDay[$],tc:y})]})]})]}):t.jsxs("div",{className:"py-16 flex flex-col items-center gap-3 text-center",children:[t.jsx(f,{className:"w-8 h-8 text-amber-500/80 dark:text-amber-300/70",strokeWidth:1.4}),t.jsx("p",{className:"text-[14px] text-slate-700 dark:text-stone-200",children:y("登录后开始记录你的圣经学习足迹")}),t.jsx("button",{type:"button",onClick:()=>g("auth"),className:"mt-1 rounded-full px-5 py-2 text-[13px] font-medium text-white bg-amber-600 hover:bg-amber-700 transition",children:y("去登录")})]})})]})};export{B as FootprintZen,B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.