PageSourceSearch

https://morningmail.ai/_nuxt/C36xBOOE.js

js morningmail.ai collected 2026-10-05 12:18:19 UTC 6,517 bytes, 1 lines download raw bytes

1import{_ as ie}from"./Cl5_tg-7.js";import{d as re,u as le,l as ce,a4 as de,a3 as ue,a5 as me,ak as pe,k as v,s as $,N as q,A as N,c as m,g as c,f as _,w as O,a as n,a1 as fe,aF as ve,v as _e,t as p,F as he,q as ye,i as ge,ae as Me,b as h,p as ke,o as d,j as we,C as be,O as Ee,_ as Se}from"./C_pwUvic.js";import{_ as Te}from"./DNQp2l68.js";import{R as xe,r as Le,_ as Ae}from"./DRzvhTck.js";import{_ as Ce}from"./JR5CIJ86.js";import{u as Ne}from"./ClQCBfYh.js";import{u as Pe}from"./Ds0W5O8-.js";import{u as Be}from"./BWf73ohr.js";import"./DWqz9JEU.js";import"./C_gOoUpc.js";import"./B97TPPsk.js";import"./ChnziUQC.js";import"./DqvFe6Gx.js";import"./DdgW8t-F.js";import"./mzDL_ZuX.js";import"./CFDMWr98.js";import"./DBdJYrsf.js";import"./RdQIK0Nz.js";import"./BO0LpaBi.js";import"./DI06vf5G.js";import"./DoB5qpHX.js";import"./CdCkgZ3q.js";import"./CO4Eimym.js";import"./wrzXCuEe.js";import"./B54jpB-G.js";class De{now;elapsedMs=0;runningSinceMs=null;constructor(s){this.now=s}start(){this.runningSinceMs===null&&(this.runningSinceMs=this.now())}pause(){this.runningSinceMs!==null&&(this.elapsedMs+=this.now()-this.runningSinceMs,this.runningSinceMs=null)}resume(){this.start()}getElapsedMs(){return this.runningSinceMs===null?this.elapsedMs:this.elapsedMs+(this.now()-this.runningSinceMs)}reset(){this.elapsedMs=0,this.runningSinceMs=null}}const Fe={class:"rd-bar"},Ie={class:"rd-bar-right"},Re={class:"rd-bar-filter"},$e=["aria-label"],qe={value:"all"},Oe=["value"],Ve={key:0,class:"container ds-reader-empty"},He={class:"serif"},ze={key:1,class:"ds-reader-zero"},Ue={key:2,class:"container ds-reader-empty"},je={class:"serif"},Je=re({__name:"reader",setup(V){const{t:s}=le(),P=ce(),f=de(),S=ue(),{$authState:y}=me(),{getIdToken:H}=pe(),{listTemplates:z,getAllUserExecutions:U,executionToLetterModules:j,markExecutionOpened:J}=Ne(),{cssVars:K}=Pe(),{busy:Y,createAndOpen:G}=Be(),T=P("/home"),Q=h(()=>{const e=y?.value?.displayName||y?.value?.email||s("home.friend");return e.split(" ")[0]||e}),g=v([]),M=v([]),x=v(!0),r=v(typeof f.query.template=="string"?f.query.template:"all"),W=h(()=>M.value.some(e=>e.status==="sent")),B=h(()=>{const e=M.value.filter(t=>t.status==="sent").filter(t=>r.value==="all"||t.templateId===r.value).sort((t,a)=>a.createdAt.toMillis()-t.createdAt.toMillis());return e.map((t,a)=>{const A=g.value.find(l=>l.id===t.templateId),C=e.slice(a+1).filter(l=>l.templateId===t.templateId),b=t.createdAt.toDate(),E=j(t,C);return{id:t.id,isoDate:se(b),date:b,templateName:A?.name||s("home.todaysMorningMail"),templateId:t.templateId,modules:E,readMins:Le(E)}})}),X=h(()=>g.value.find(t=>t.status==="active")?.time||null),Z=h(()=>typeof f.query.date=="string"?f.query.date:"");$(()=>{document.body.classList.add("rd-mode")}),q(()=>{document.body.classList.remove("rd-mode")});const i=v(null);function ee(e){i.value=e}function te(e){S.push(P(`/builder/${e}`))}const k=new Set;async function ne(e){if(!e||k.has(e))return;const t=M.value.find(a=>a.id===e);if(t){if(t.openedAt){k.add(e);return}k.add(e);try{await J(e),t.openedAt=be.now(),Ee().track("edition_opened")}catch(a){k.delete(e),console.warn("[reader] mark opened failed",a)}}}N(i,e=>{ne(e)});const o=new De(()=>typeof performance<"u"?performance.now():Date.now());let u=null;async function L(){try{const e=y?.value;if(!e){u=null;return}u=await H(e)}catch(e){console.warn("[reader] getIdToken failed",e),u=null}}async function w(e,t){if(!(t<=0)&&(u||await L(),!!u))try{await fetch("/api/reader/read-time",{method:"POST",keepalive:!0,headers:{"content-type":"application/json",authorization:`Bearer ${u}`},body:JSON.stringify({executionId:e,readTimeMs:Math.round(t)})})}catch(a){console.warn("[reader] persist read-time failed",a)}}function D(){typeof document>"u"||(document.visibilityState==="visible"?(o.resume(),L()):(o.pause(),i.value&&w(i.value,o.getElapsedMs())))}function F(){o.pause(),i.value&&w(i.value,o.getElapsedMs())}N(i,(e,t)=>{t&&t!==e&&(w(t,o.getElapsedMs()),o.reset()),e&&typeof document<"u"&&document.visibilityState==="visible"&&o.start()});function I(){i.value=null,S.replace({query:{...f.query,template:r.value==="all"?void 0:r.value}}),document.scrollingElement&&(document.scrollingElement.scrollTop=0)}function ae(){r.value="all",I()}function se(e){return`${e.getFullYear()}
1-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function R(e){if(e.key==="Escape")S.push(T);else if(e.key==="Home")document.scrollingElement&&(document.scrollingElement.scrollTop=0);else if(e.key==="End"){const t=document.scrollingElement;t&&(t.scrollTop=t.scrollHeight)}}$(()=>{document.addEventListener("keydown",R),document.addEventListener("visibilitychange",D),window.addEventListener("pagehide",F),document.visibilityState==="visible"&&o.start(),L()}),q(()=>{document.removeEventListener("keydown",R),document.removeEventListener("visibilitychange",D),window.removeEventListener("pagehide",F),o.pause(),i.value&&w(i.value,o.getElapsedMs())});async function oe(){x.value=!0;try{const[e,t]=await Promise.all([z(),U(60).then(a=>a.executions).catch(()=>[])]);g.value=e,M.value=t}finally{x.value=!1}}return N(()=>y?.value?.uid,e=>{e&&oe()},{immediate:!0}),(e,t)=>{const a=ie,A=ke,C=Te,b=Ae,E=Ce;return d(),m("div",{class:"reader-page rd-mode-page",style:Me(n(K))},[c("div",Fe,[_(A,{class:"rd-bar-home mono",to:n(T)},{default:O(()=>[_(a,{class:"icon icon-sm"}),c("span",null,p(n(s)("nav.home")),1)]),_:1},8,["to"]),c("div",Ie,[c("span",Re,[fe(c("select",{"onUpdate:modelValue":t[0]||(t[0]=l=>_e(r)?r.value=l:null),class:"rd-bar-select mono","aria-label":n(s)("reader.filter"),onChange:I},[c("option",qe,p(n(s)("reader.allTemplates")),1),(d(!0),m(he,null,ye(n(g),l=>(d(),m("option",{key:l.id,value:l.id},p(l.name||n(s)("templates.draftName")),9,Oe))),128))],40,$e),[[ve,n(r)]])]),_(C)])]),n(x)?(d(),m("div",Ve,[c("p",He,p(n(s)("reader.loading")),1)])):n(W)?n(B).length?(d(),ge(xe,{key:n(r),editions:n(B),"next-landing-time":n(X),"initial-date":n(Z)||null,"top-fallback":"",onCurrentChange:ee,onConfigure:te},null,8,["editions","next-landing-time","initial-date"])):(d(),m("div",Ue,[c("p",je,p(n(s)("reader.empty")),1),_(E,{onClick:ae},{default:O(()=>[we(p(n(s)("reader.showAll")),1)]),_:1})])):(d(),m("div",ze,[_(b,{variant:"reader","recipient-name":n(Q),busy:n(Y),"secondary-cta-to":n(T),"secondary-label":n(s)("reader.sampleBackHome"),onPrimary:n(G)},null,8,["recipient-name","busy","secondary-cta-to","secondary-label","onPrimary"])]))],4)}}}),yt=Se(Je,[["__scopeId","data-v-60ef87fc"]]);export{yt 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.