PageSourceSearch

https://dayoneweb.onrender.com/assets/URLFunctions.9f346b7d-CuckpKBe.js

js dayoneweb.onrender.com collected 2026-10-03 11:40:57 UTC 5,102 bytes, 3 lines download raw bytes

1import{t as C}from"./Sentry.01a0bcb0-DMHAnFbv.js";import{a as J,i as T,n as W,r as g,t as j}from"./consts.161545f9-x4mjZkys.js";import{i as b,n as F,t as h}from"./toDate.c829e0e4-DmLyWCcY.js";import{t as V}from"./LocationHistoryViewState.b5431f8e-CIHAZJIm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"2026.20"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0506fab0-6240-4838-946e-5d93d75d38d4",e._sentryDebugIdIdentifier="sentry-dbid-0506fab0-6240-4838-946e-5d93d75d38d4")}catch{}})();function x(e,n,t){return F(t?.in||e,+h(e)+n)}function B(e,n,t){return x(e,n*b,t)}var A=e=>e.startsWith("/all/")||e==="/all"||e==="/"||e==="/settings"||e.startsWith("/shared-journals-info")||e==="/calendar"||e==="/calendar/"||e.startsWith("/calendar/all")||e==="/media/"||e.startsWith("/media/all")||e.startsWith("/announcement");async function X(e,n,t,o,i,s,l,c,a,r,f,v,u){await M(e,n,t,o,i,l,a,r,s,f)&&z(e,n,i,l,s,c,r,v,u)}async function M(e,n,t,o,i,s,l,c,a,r){const f=await o.getActiveUser()!==null,v=t&&f===!1,u=A(e);if(v)return l(u?"/login":"/login?next="+encodeURIComponent(window.location.href)),!1;if(n?.collectionId){const d=r.journalCollections?await a.getByClientId(n.collectionId):void 0;if(!(d&&d.type==="collection"&&d.deleted_at===null&&d.is_decrypted===1)){const R=e.startsWith("/calendar")?j:e.startsWith("/media")?g:T;return l(O(R)),!1}}if(u&&c.totalJournalCount===1){if(c.journals[0]?.is_decrypted){const d=c.journals[0];l($(d.id,c.selectedEntryView))}else l("/");return!1}const D=await U(i,s,n?.journalId,n?.entryId),I=D.journal==="VALID",_=D.entry==="VALID",y=I&&n?.journalId||null,E=_&&n?.entryId||null;return!u&&y&&E&&!c.userCanNavigateToJournal(y)?(l(k(y,E,c.selectedEntryView,!0)),!1):!0}async function z(e,n,t,o,i,s,l,c,a){if(e.startsWith("/calendar")?S(l,n,c,o):e.startsWith("/media")?l.selectEntryView(g):e.startsWith("/home")?l.selectEntryView(W):e.startsWith("/journal-not-found")||e.startsWith("/journal-encrypted")||e.startsWith("/entry-not-found")||l.selectEntryView(T),!n||!n.journalId&&!n.promptId&&!n.visitId&&!n.collectionId){l.selectJournal(J);return}if(n.collectionId&&!n.journalId){l.selectJournalCollection(n.collectionId),await L(n.collectionId,null,i,o,s);return}const r=await U(t,o,n.journalId,n.entryId,n.promptId,n.visitId),f=r.journal==="VALID",v=r.entry==="VALID",u=r.prompt==="VALID",D=r.visit==="VALID",I=f&&n.journalId||null,_=v&&n.entryId||null,y=u&&n.promptId||null,E=D&&n.visitId||null;if(n.collectionId?await L(n.collectionId,f?n.journalId??null:null,i,o,s):n.journalId&&f&&await o.addJournalToSyncJobs(n.journalId)&&s(),I&&_){const d=A(e);l.selectEntry({journal_id:I,id:_},d,n.collectionId??null)}else if(y)l.selectPrompt(I||"All_Entries",y);else if(I)l.selectJournal(I);else if(E){const d=V();d.setFocusedItem(E),d.setSelectedVisitId(E)}if(r.journal==="ENCRYPTED"){const d=n?.entryId?`&eid=${n?.entryId}`:"";a(`/journal-encrypted?jid=${n?.journalId}${d}`);return}else if(r.journal==="NOT_FOUND"){a(`/journal-not-found?jid=${n?.journalId}`);return}else if(r.entry==="NOT_FOUND"){a(`/entry-not-found?jid=${n?.journalId}&eid=${n?.entryId}`);return}}async function L(e,n,t,o,i){try{const s=new Set(await t.getMemberJournalIds(e));if(n&&s.add(n),s.size===0)return;(await Promise.all([...s].map(l=>o.addJournalToSyncJobs(l)))).some(l=>l)&&i()}catch(s){C.captureException(s)}}var H=async(e,n)=>{const t=await e.getById(n);if(!await e.isSyncable(n))return"NOT_FOUND";if(t){if(t.is_decrypted===0)return"ENCRYPTED"}else return"NOT_FOUND";return"VALID"},Y=async(e,n,t)=>!!await e.getEntryById(n,t),U=async(e,n,t,o,i,s)=>{const l={journal:"NOT_SELECTED",entry:"NOT_SELECTED",prompt:"NOT_SELECTED",visit:"NOT_SELECTED"};return t&&(l.journal=await H(e,t),o&&(await Y(n,t,o)?l.entry="VALID":l.entry="NOT_FOUND")),i&&(l.prompt="VALID"),s&&(l.visit="VALID"),l},S=async(e,n,t,o)=>{if(e.selectEntryView(j),n&&n.date){const i=new Date(n.date),s=B(i,i.getTimezoneOffset()/60);t.setSelectedDate(s.toISOString()),t.setDateSetFromURL(!0)}else t.setDateSetFromURL(!1);if(n&&n.journalId&&n.entryId){const i=await o.getEntryById(n.journalId,n.entryId);i&&t.setSelectedDate(new Date(i.date).toISOString())}},$=(e,n)=>w(e,n),w=(e,n,t=!1)=>t?n==="calendar_view"?`/calendar/all/${e}
1`:n==="media_view"?`/media/all/${e}`:`/all/${e}`:n==="calendar_view"?`/calendar/${e}`:n==="media_view"?`/media/${e}`:`/journals/${e}`,N=(e,n)=>n==="calendar_view"?`/calendar/collections/${e}`:n==="media_view"?`/media/collections/${e}`:`/collections/${e}`,k=(e,n,t,o=!1,i=null)=>i?`${N(i,t)}/${e}/${n}`:`${w(e,t,o)}/${n}`,O=e=>e==="calendar_view"?"/calendar/all":e==="media_view"?"/media/all":e==="home_view"?"/home/all":"/all",Z=(e,n,t=null)=>t?N(t,n):!e||e==="All_Entries"?O(n):$(e,n),m=e=>{const n=q();return n?`/${e}?next=${encodeURIComponent(n)}`:`/${e}`},q=()=>new URLSearchParams(window.location.search).get("next");export{w as a,m as c,k as i,X as l,Z as n,q as o,N as r,$ as s,O as t};
2
3//# sourceMappingURL=URLFunctions.9f346b7d-CuckpKBe.js.map

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.