PageSourceSearch

https://reflect.app/_next/static/chunks/4531.5e0ec3797b4c769c.js

js reflect.app collected 2026-09-24 08:53:00 UTC 39,391 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6c59c5e6-9b57-4fcf-a477-bb7dd3d79823",e._sentryDebugIdIdentifier="sentry-dbid-6c59c5e6-9b57-4fcf-a477-bb7dd3d79823")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4531],{24531:function(e,t,s){s.r(t),s.d(t,{PreferencesGraph:function(){return eN}});var r=s(11527),a=s(72811),i=s(50959),l=s(62107),n=s(43917),o=s(87540),c=s.n(o),d=s(55621),m=s(43445),x=s(719);let h=(0,a.Pi)(e=>{let{open:t,onOpenChange:s,graph:a}=e,[l,n]=(0,i.useState)([]),[o,h]=(0,i.useState)(!1),p=(0,i.useCallback)(async()=>{h(!0);try{let e=await (0,x._H)({graphId:a.id});n(e)}catch(e){console.error("Failed to load backups:",e)}finally{h(!1)}},[a.id]);return(0,i.useEffect)(()=>{t&&p()},[p,t]),(0,r.jsx)(m.Vq,{open:t,onOpenChange:s,children:(0,r.jsxs)(m.cZ,{className:"max-w-2xl",children:[(0,r.jsxs)(m.fK,{children:[(0,r.jsx)(m.$N,{children:"Backups"}),(0,r.jsx)(m.Be,{children:"We make daily automatic backups of Reflect to your hard drive."})]}),(0,r.jsxs)("div",{className:"mt-4",children:[o?(0,r.jsx)("div",{className:"py-8 text-center text-gray-500 dark:text-gray-400",children:"Loading backups..."}):0===l.length?(0,r.jsx)("div",{className:"py-8 text-center text-gray-500 dark:text-gray-400",children:"No backups found for this graph."}):(0,r.jsx)("div",{className:"space-y-2",children:l.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("span",{className:"flex-1 truncate text-xs",title:e,children:e}),(0,r.jsx)(d.z,{variant:"secondary",size:"sm",onClick:()=>{(0,x.w4)({graphId:a.id,backup:e})},children:"Export backup"})]},e))}),(0,r.jsx)("div",{className:"flex pt-6",children:(0,r.jsx)(c(),{href:"/debug/backups",className:"text-xs text-gray-500 underline underline-offset-4 dark:text-gray-400",children:"Download backups of all graphs"})})]})]})})}),p=(0,a.Pi)(e=>{let{graph:t}=e,[s,a]=(0,i.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h3",{className:"text-xl font-medium leading-7 text-gray-900 dark:text-near-white",children:"Backups"}),(0,r.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-gray-500 dark:text-near-white",children:"View and manage automated daily backups for this graph."}),(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsx)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-end sm:gap-4 sm:border-t sm:pt-5",children:(0,r.jsx)("div",{className:"mt-1 flex flex-col space-y-3 sm:col-span-2 sm:mt-0",children:(0,r.jsx)(n.m,{onClick:()=>{a(!0)},children:"Show backups"})})})})]}),(0,r.jsx)(h,{open:s,onOpenChange:a,graph:t})]})});var u=s(74014),g=s(55329),f=s(95321),j=s(44555);let y=(0,a.Pi)(e=>{let{graph:t,open:s,onClose:a}=e,[l,n]=(0,i.useState)(!1),[o,c]=(0,i.useState)(""),d=async e=>{e.preventDefault(),l||o!==t.id||(n(!0),await (0,j._3)(t.id),n(!1),c(""),a())};return(0,r.jsx)(g.oU,{open:s,onClose:a,children:(0,r.jsxs)("div",{className:"max-w-sm space-y-10",children:[(0,r.jsxs)("div",{className:"space-y-5 text-center",children:[(0,r.jsx)("h3",{className:"text-3xl font-medium leading-6 text-gray-800 dark:text-near-white",children:"Confirm graph deletion"}),(0,r.jsxs)("p",{className:"text-gray-500 dark:text-gray-300",children:["This will delete the graph ",t.nameWithId," and all its notes."," ",(0,r.jsx)("strong",{children:"This action is permanent."})]})]}),(0,r.jsx)("div",{children:(0,r.jsxs)("form",{onSubmit:d,children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-near-white",children:"Graph identifier"}),(0,r.jsx)("div",{className:"mt-2 block w-full min-w-0 flex-1 rounded-md bg-gray-200 py-2 px-3 sm:text-sm sm:leading-5",children:t.id})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-near-white",children:"Confirm graph to delete"}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(f.o,{placeholder:"Re-enter the graph identifier above",value:o,onChange:e=>c(e)})})]})]}),(0,r.jsx)("div",{className:"mt-7",children:(0,r.jsx)(u.M,{disabled:t.id!==o,className:"bg-red-500 hover:bg-red-600",loading:l,label:"Delete graph",loadingLabel:"Deleting..."})})]})})]})})}),v=(0,a.Pi)(e=>{let{graph:t}=e,[s,a]=(0,i.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h3",{className:"text-xl font-medium leading-7 text-gray-900 dark:text-near-white",children:"Danger area"}),(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsx)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-start sm:gap-4 sm:border-t sm:pt-5",children:(0,r.jsx)("div",{className:"flex flex-col sm:col-span-2",children:(0,r.jsx)("a",{onClick:()=>a(!0),className:"cursor-pointer text-sm font-medium text-red-600 transition duration-300",children:"Delete this graph"})})})})]}),(0,r.jsx)(y,{graph:t,open:s,onClose:()=>a(!1)})]})});var b=s(33055),N=s(88338),w=s(50682),k=s(14864),C=s(4199),I=s(49849),S=s(65979),E=s(54159),D=s(5955),P=s(60773),Z=s(15767),T=s(44838),L=s(73419),_=s(25684),K=s(46222),R=s(11508);class M{setLoading(e){this.loading=e}setRecoveryKit(e){this.recoveryKit=e}async changePassword(e){var t;let s=this.graph,r=s.encryptionKey;(0,w.Ee)(r,"masterKey is not set"),this.setLoading(!0),await (0,L.Z)(100),await (0,K.e)({newPassword:e,graphId:s.id,masterKey:r});let a=await (0,k.fL)({graphId:s.id,masterKey:r});
1this.setRecoveryKit(a),null===R.Z||void 0===R.Z||null===(t=R.Z.setPassword)||void 0===t||t.call(R.Z,s.id,e),(0,_.j)("password_changed",{graphId:s.id}),this.setLoading(!1)}downloadRecoveryKey(){(0,w.hu)(this.recoveryKit,"recoveryKit is not set"),(0,N.D)(this.recoveryKit)}constructor(e){this.loading=!1,this.graph=e,(0,T.makeObservable)(this)}}(0,Z.gn)([T.observable],M.prototype,"graph",void 0),(0,Z.gn)([T.observable],M.prototype,"loading",void 0),(0,Z.gn)([T.observable],M.prototype,"recoveryKit",void 0),(0,Z.gn)([T.action],M.prototype,"setLoading",null),(0,Z.gn)([T.action],M.prototype,"setRecoveryKit",null),(0,Z.gn)([T.action],M.prototype,"changePassword",null);let B=(0,a.Pi)(e=>{let{graph:t,onClose:s}=e,[a,l]=(0,i.useState)(!1),[n,o]=(0,i.useState)(""),[c,d]=(0,i.useState)(""),m=(0,i.useMemo)(()=>new M(t),[t]),x=async e=>{e.preventDefault();let t=n&&n===c;l(!t),t&&await m.changePassword(n)};return m.recoveryKit?(0,r.jsx)(E.o,{onClose:s,children:(0,r.jsxs)("div",{className:"sm:my-8 sm:mx-auto sm:w-full sm:max-w-sm sm:p-6 sm:align-middle",children:[(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("h3",{className:"text-3xl font-medium leading-6 text-gray-800 dark:text-near-white",children:"Your Recovery Kit"}),(0,r.jsxs)("div",{className:"mx-3 my-10 space-y-2",children:[(0,r.jsx)("p",{className:"text-sm leading-5 text-bluegray-500",children:"We use your password to securely end-to-end encrypt your notes. This means no one else can read them."}),(0,r.jsx)("p",{className:"text-sm leading-5 text-bluegray-500",children:"Let's create a recovery kit as a backup to your password (in case you ever lose it)."})]})]}),(0,r.jsx)("div",{className:"mt-5",children:(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)(S.M,{onClick:()=>{m.downloadRecoveryKey(),s()},children:[(0,r.jsx)(C.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:"Download recovery kit"})]})})})]})}):(0,r.jsx)(E.o,{onClose:s,children:(0,r.jsxs)("div",{className:"m-auto mt-3 max-w-sm sm:mt-5",children:[(0,r.jsxs)("div",{className:"space-y-3 text-center",children:[(0,r.jsx)("h3",{className:"text-2xl font-medium leading-6 text-gray-800 dark:text-near-white",children:"Encryption password change"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-300",children:"We strongly suggest using a password manager to generate a unique single-use password."})]}),(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsxs)("form",{onSubmit:x,children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-near-white",children:"Graph"}),(0,r.jsx)("div",{className:"mt-2 block w-full min-w-0 flex-1 rounded-md bg-gray-200 py-2 px-3 sm:text-sm sm:leading-5",children:t.nameWithId})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-near-white",children:"New password"}),(0,r.jsxs)("div",{className:"relative mt-2",children:[(0,r.jsx)(D.W,{autoComplete:"new-password",value:n,onChange:o,disabled:m.loading}),(0,r.jsx)("div",{className:"absolute inset-y-0 right-0 flex cursor-help items-center pr-3 text-bluegray-300 hover:text-bluegray-400",children:(0,r.jsx)(P.u,{label:"Passwords must be at least eight characters. Passwords don't leave your machine and only be recovered using the provided Recovery Kit.",children:(0,r.jsx)(I.Z,{width:20,height:20})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-near-white",children:"Confirm new password"}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(D.W,{autoComplete:"new-password",value:c,onChange:d,disabled:m.loading})}),a&&(0,r.jsx)("p",{className:"mt-2 text-sm text-red-600",id:"email-error",children:"Password confirmation did not match."})]})]}),(0,r.jsx)("div",{className:"mt-10",children:(0,r.jsx)(S.M,{loading:m.loading,children:"Change password"})})]})})]})})}),F=(0,a.Pi)(e=>{let{graph:t}=e,[s,a]=(0,i.useState)(!1),l=async()=>{(0,w.Ee)(t.encryptionKey);let e=await (0,k.fL)({graphId:t.id,masterKey:t.encryptionKey});(0,N.D)(e)};return(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)(B,{graph:t,onClose:()=>a(!1)}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h3",{className:"text-xl font-medium leading-7 text-gray-900 dark:text-near-white",children:"Edit your graph"}),(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsxs)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-start sm:gap-4 sm:border-t sm:pt-5",children:[(0,r.jsx)("label",{className:"block text-sm font-medium leading-5 text-gray-700 dark:text-near-white",children:"Identifier"}),(0,r.jsx)("div",{className:"flex flex-col space-y-3 sm:col-span-2 sm:mt-0",children:(0,r.jsx)("div",{className:"max-w-72 select-text text-sm",children:t.id})})]})}),(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsxs)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-start sm:gap-4 sm:border-t sm:pt-5",children:[(0,r.jsx)("label",{className:"block text-sm font-medium leading-5 text-gray-700 dark:text-near-white",children:"Name"}),(0,r.jsx)("div",{className:"flex flex-col space-y-3 sm:col-span-2 sm:mt-0",children:(0,r.jsx)("div",{className:"max-w-72",children:(0,r.jsx)(f.o,{required:!0,value:t.name,onChange:e=>t.setName(e),onBlur:()=>
1t.update()})})})]})}),(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsxs)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-start sm:gap-4 sm:border-t sm:pt-5",children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-near-white",children:"Color"}),(0,r.jsx)("div",{className:"sm:col-span-3",children:(0,r.jsx)(b.W,{value:t.colorHex,onChange:e=>t.updateColorHex(e)})})]})}),t.encryptionKey&&(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsxs)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-start sm:gap-4 sm:border-t sm:pt-5",children:[(0,r.jsx)("label",{className:"block text-sm font-medium leading-5 text-gray-700 dark:text-near-white",children:"Encryption"}),(0,r.jsxs)("div",{className:"flex flex-col space-y-3 sm:col-span-2 sm:mt-0",children:[(0,r.jsx)("a",{className:"cursor-pointer text-xs font-medium text-indigo-600 transition duration-300 dark:text-near-white dark:hover:text-purple-500",onClick:()=>a(!0),children:"Change encryption password"}),(0,r.jsx)("a",{className:"cursor-pointer text-xs font-medium text-indigo-600 transition duration-300 dark:text-near-white dark:hover:text-purple-500",onClick:()=>l(),children:"Download recovery kit"})]})]})})]})]})});var A=s(55044),O=s(9832);let V=(0,a.Pi)(e=>{let{graph:t}=e,[s,a]=(0,i.useState)("reflect_open_zip");return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h3",{className:"text-xl font-medium leading-7 text-gray-900 dark:text-near-white",children:"Export your notes"}),(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsxs)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-end sm:gap-4 sm:border-t sm:pt-5",children:[(0,r.jsx)("div",{className:"block text-gray-700 dark:text-near-white",children:(0,r.jsx)("div",{className:"max-w-44",children:(0,r.jsx)(A.P,{selectedValue:s,onChange:e=>a(e),label:"Select format",options:Object.entries(O.xH)})})}),(0,r.jsx)("div",{className:"mt-1 flex flex-col space-y-3 sm:col-span-2 sm:mt-0",children:(0,r.jsx)(n.m,{onClick:()=>(0,O.aT)(t,s),children:"Export notes"})})]})})]})})});var W=s(65925);let H={reflect:[{description:"Reflect JSON",accept:{"application/json":[".json"]}}],...W.P7};var z=s(13402);let J=e=>{let{children:t,acceptTypes:s,onChange:a}=e,i=(s||[]).map(e=>{let{accept:t}=e;return Object.values(t||{})}).flat(2),l=i.length>0?i.join(","):void 0;return(0,r.jsxs)(z.mI,{className:"relative",children:[(0,r.jsx)("input",{type:"file",className:"absolute inset-0 z-10 w-full cursor-pointer opacity-0",accept:l,multiple:!0,value:[],onChange:e=>{a([...e.currentTarget.files])}}),t]})};var q=s(39643),G=s(71753),U=s(34013),Y=s(97812),Q=s(28251),$=s(19884),X=s(92005);class ee{get isValid(){return!!this.documentNode&&!this.duplicate&&0===this.errors.length}setProcessed(e){this.processed=e}setImported(e){this.imported=e}setDuplicate(e){this.duplicate=e}addError(e){this.errors.push(e)}get hasErrors(){return this.errors.length>0}get subject(){var e;return null===(e=this.creationData)||void 0===e?void 0:e.subject}parseDocument(){try{var e;this.documentNode=null===(e=this.buildDocument)||void 0===e?void 0:e.call(this)}catch(e){this.addError(e instanceof Error?e.message:String(e))}finally{this.setProcessed(!0)}}buildNote(){return this.documentNode||this.parseDocument(),(0,w.hu)(this.creationData,"creationData missing"),(0,w.hu)(this.documentNode,"documentNode missing"),l.jC.build({...this.creationData,documentNode:this.documentNode,updatedAt:Date.now()})}constructor({id:e,creationData:t,backlinks:s=[],tags:r=[],errors:a=[]},i){this.processed=!1,this.imported=!1,this.duplicate=!1,this.id=e,this.errors=a,this.creationData=t,this.backlinks=s,this.tags=r,this.buildDocument=i,(0,T.makeObservable)(this)}}(0,Z.gn)([T.observable],ee.prototype,"errors",void 0),(0,Z.gn)([T.observable],ee.prototype,"processed",void 0),(0,Z.gn)([T.observable],ee.prototype,"imported",void 0),(0,Z.gn)([T.observable],ee.prototype,"duplicate",void 0),(0,Z.gn)([T.action],ee.prototype,"setProcessed",null),(0,Z.gn)([T.action],ee.prototype,"setImported",null),(0,Z.gn)([T.action],ee.prototype,"setDuplicate",null),(0,Z.gn)([T.action],ee.prototype,"addError",null),(0,Z.gn)([T.computed],ee.prototype,"hasErrors",null),(0,Z.gn)([T.action],ee.prototype,"parseDocument",null);var et=s(11391);function es(e){if(!e)return;let t=new Date(e);if((0,et.J)(t))return t}class er{async import(e){let{data:t}=e,s=JSON.parse(t);if(s.export_version!==O.Rh)throw new W.hV("Malformed export file");if(!Array.isArray(s.notes))throw new W.hV("Malformed Reflect import file");return s.notes.map(e=>this.buildImport(e))}buildImport(e){let t=es(e.created_at),s=es(e.edited_at),r=es(e.daily_at),a=r?(0,X.l5)(r):e.id;return new ee({id:a,creationData:{id:a,subject:e.subject,createdAt:null==t?void 0:t.getTime(),editedAt:null==s?void 0:s.getTime(),daily:!!r,backlinkedCount:e.backlinked_count}},()=>this.buildDocumentNode(e))}buildDocumentNode(e){let t=JSON.parse(e.document_json),s=(0,$.hH)(t);return(0,l.vm)({node:s,graphId:this.graph.id})}constructor({graph:e}){this.accept={"application/json":[".json"]},this.graph=e}}class ea{async import(e){let{notes:t,errors:s}=await this.convertor.convert(e);return[...t.map(e=>this.buildImport(e)),...s.map(e=>this.buildImportError(e))]}buildImport(e){var t,s;let r=e.dailyAt?(0,X.l5)(e.dailyAt):e.id;return new ee({id:r,creationData:{id:r,subject:e.subject||"",daily:!!e.dailyAt,createdAt:e.createdAt,editedAt:e.updatedAt},backlinks:null!==(t=e.backlinks)&&void 0!==t?t:[],tags:null!==(s=e.tags)&&void 0!==s?s:[]},()=>this.buildDocumentNode(e))}buildImportError(e){return new ee({id:e.id,errors:[e.type]})}buildDocumentNode(e){return(0,$.R7)(e.html)}constructor({graph:e,format:t}){let s=W.Yq[t];
1this.graph=e,this.convertor=new s({graphId:e.id})}}class ei{import(e){return this.importer.import(e)}constructor({graph:e,format:t}){"reflect"===t?this.importer=new er({graph:e}):this.importer=new ea({graph:e,format:t})}}class el{get totalCount(){return this.importNotes.length}get validCount(){return this.importNotes.filter(e=>e.isValid).length}get processedCount(){return this.importNotes.filter(e=>e.processed).length}get importedCount(){return this.importNotes.filter(e=>e.imported).length}get duplicateImportNotes(){return this.importNotes.filter(e=>e.duplicate)}get duplicateCount(){return this.importNotes.filter(e=>e.duplicate).length}get errorsCount(){return this.importNotes.filter(e=>e.hasErrors).length}get readyToImportNotes(){return this.importNotes.filter(e=>e.isValid&&!e.imported)}get readyToImportCount(){return this.readyToImportNotes.length}setErrorMessage(e){this.errorMessage=e}async importFile(e){let t=await new Promise((t,s)=>{let r=new FileReader;r.readAsText(e,"UTF-8"),r.addEventListener("load",()=>t(r.result)),r.addEventListener("error",()=>s(r.error))}),s=await this.importer.import({data:t,filename:e.name,lastModified:e.lastModified});this.addImportNotes(s)}async safeImportFile(e){try{await this.importFile(e)}catch(e){return(0,Q.Tb)(e),this.setState("preparing_error"),this.setErrorMessage(e instanceof Error?e.message:String(e)),!1}return!0}async prepareImport(){for(let e of(this.setState("preparing"),this.setImportNotes([]),this.files))if(!await this.safeImportFile(e))return;for(let e of(await (0,L.Z)(1),this.importNotes)){if(await this.findExistingNoteById(e.id)){e.setDuplicate(!0);continue}e.parseDocument()}this.setState("prepared")}async startImport(){if(this.setState("importing"),!this.graphIsReady){this.setState("graph_error");return}for(let e of(0,G.Z)(this.readyToImportNotes,300)){if("importing"!==this.state)return;await this.saveImportNotes(e)}await this.saveBacklinks(await this.getOrphanedBacklinks()),await this.saveTags(this.tags),this.setState("imported")}cancelImport(){this.setState("cancelled")}get backlinks(){return this.importNotes.flatMap(e=>e.backlinks)}get tags(){return(0,U.Z)(this.importNotes.flatMap(e=>e.tags))}async getOrphanedBacklinks(){let e=[];for(let t of this.backlinks){let s=t.id,r=this.findImportNoteById(s),a=await this.findExistingNoteById(s);r||a||e.push(t)}return e}get noteImportErrors(){return this.importNotes.flatMap(e=>e.errors.map(t=>({noteId:e.id,error:t})))}async saveImportNotes(e){try{let t=e.map(e=>e.buildNote());await (0,Y.gw)({graph:this.graph,notes:t,createInitialCommit:!0}),e.forEach(e=>e.setImported(!0))}catch(t){(0,Q.Tb)(t),e.forEach(e=>e.addError(t instanceof Error?t.message:String(t)))}}async saveBacklinks(e){if(0===e.length)return;let t=e.map(e=>{let{id:t,label:s}=e;return l.jC.build({id:t,subject:s})});await (0,Y.gw)({graph:this.graph,notes:t,createInitialCommit:!0})}async saveTags(e){0!==e.length&&await this.graph.batchCreateTags(e)}get graphIsReady(){return!this.graph.isEncrypted||!!this.graph.encryptionKey}findImportNoteById(e){return this.importNotes.find(t=>t.id===e)}findExistingNoteById(e){return this.graph.noteStore.findById(e)}setState(e){this.state=e}addImportNotes(e){this.importNotes=this.importNotes.concat(e)}setImportNotes(e){this.importNotes=e}constructor({graph:e,files:t,format:s}){this.errorMessage=null,this.importNotes=[],this.files=t,this.graph=e,this.format=s,this.state="pending",this.importer=new ei({graph:e,format:s}),(0,T.makeObservable)(this)}}(0,Z.gn)([T.observable],el.prototype,"importNotes",void 0),(0,Z.gn)([T.observable],el.prototype,"state",void 0),(0,Z.gn)([T.observable],el.prototype,"errorMessage",void 0),(0,Z.gn)([T.computed],el.prototype,"totalCount",null),(0,Z.gn)([T.computed],el.prototype,"validCount",null),(0,Z.gn)([T.computed],el.prototype,"processedCount",null),(0,Z.gn)([T.computed],el.prototype,"importedCount",null),(0,Z.gn)([T.computed],el.prototype,"duplicateImportNotes",null),(0,Z.gn)([T.computed],el.prototype,"duplicateCount",null),(0,Z.gn)([T.computed],el.prototype,"errorsCount",null),(0,Z.gn)([T.computed],el.prototype,"readyToImportNotes",null),(0,Z.gn)([T.computed],el.prototype,"readyToImportCount",null),(0,Z.gn)([T.action],el.prototype,"setErrorMessage",null),(0,Z.gn)([T.action],el.prototype,"setState",null),(0,Z.gn)([T.action],el.prototype,"addImportNotes",null),(0,Z.gn)([T.action],el.prototype,"setImportNotes",null);var en=s(70032),eo=s(67961);let ec=()=>(0,r.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center",children:(0,r.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center space-x-3",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-red-400 text-white ring-8 ring-white",children:(0,r.jsx)(eo.Z,{className:"h-5 w-5"})}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 items-center justify-between space-x-4",children:(0,r.jsx)("h2",{className:"text-lg text-gray-500 dark:text-near-white",children:"Graph Error"})})]}),(0,r.jsx)("div",{className:"mt-5 flex justify-center",children:(0,r.jsx)("p",{className:"max-w-[150px] text-sm text-gray-500 dark:text-near-white",children:"Please sign-into your graph before importing."})})]})})});var ed=s(60221);let em=(0,a.Pi)(e=>{let{view:t,onClose:s}=e;return(0,r.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center",children:(0,r.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center space-x-3",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-green-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(ed.Z,{className:"h-5 w-5"})}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 items-center justify-between space-x-4",children:(0,r.jsx)("h2",{className:"text-lg text-gray-500 dark:text-near-white",children:"Import complete"})})]}),(0,r.jsx)("div",{className:"mt-5 flex justify-center",children:(0,r.jsxs)("p",{className:"max-w-[150px] text-sm text-gray-500 dark:text-near-white",children:["Sucessfully imported"," ",(0,r.jsxs)("span",{className:"font-medium text-gray-900 dark:text-near-white",children:[t.importedCount.toLocaleStr
1ing()," notes"]}),"."]})}),(0,r.jsx)("div",{className:"mt-10",children:(0,r.jsx)("a",{className:"inline-flex cursor-pointer items-center justify-center px-3 text-sm font-medium text-bluegray-500 dark:text-near-white",onClick:s,children:"Close"})})]})})})}),ex=e=>{let{className:t=""}=e;return(0,r.jsxs)("svg",{className:"animate-spin text-primary ".concat(t),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})},eh=(0,a.Pi)(e=>{let{view:t}=e;return(0,r.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,r.jsxs)("div",{className:"space-y-2 text-center text-bluegray-900 dark:text-near-white",children:[(0,r.jsx)("h2",{className:"text-lg",children:"Importing notes"}),(0,r.jsxs)("h3",{className:"text-sm",children:["Imported ",t.importedCount.toLocaleString()," out of"," ",t.validCount.toLocaleString(),"..."]})]}),(0,r.jsx)("div",{className:"m-10 flex flex-none items-center justify-center",children:(0,r.jsx)(ex,{className:"h-8 w-8"})})]})})});var ep=s(99499),eu=s(7134),eg=s(64940);let ef=(0,a.Pi)(e=>{let{view:t}=e;return(0,r.jsx)("div",{className:"flex flex-1 flex-col",children:(0,r.jsxs)("ul",{role:"list",className:"-mb-8",children:[(0,r.jsx)("li",{children:(0,r.jsxs)("div",{className:"relative pb-8",children:[(0,r.jsx)("span",{className:"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"relative flex space-x-3",children:[(0,r.jsx)("div",{children:(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-green-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(ep.Z,{className:"h-5 w-5"})})}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 justify-between space-x-4 pt-1.5",children:(0,r.jsx)("div",{children:(0,r.jsxs)("p",{className:"text-sm text-gray-500 dark:text-near-white",children:["Processed"," ",(0,r.jsxs)("span",{className:"font-medium text-gray-900 dark:text-white",children:[t.totalCount.toLocaleString()," notes"]})]})})})]})]})}),(0,r.jsx)("li",{children:(0,r.jsxs)("div",{className:"relative pb-8",children:[(0,r.jsx)("span",{className:"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"relative flex space-x-3",children:[(0,r.jsx)("div",{children:t.errorsCount>0?(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-red-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(eo.Z,{className:"h-5 w-5"})}):(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-green-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(ep.Z,{className:"h-5 w-5"})})}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 justify-between space-x-4 pt-1.5",children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm text-gray-500 dark:text-near-white",children:["Encounted"," ",(0,r.jsxs)("span",{className:"font-medium text-gray-900 dark:text-white",children:[t.errorsCount.toLocaleString()," errors"]})," ","while parsing"]}),t.errorsCount>0&&(0,r.jsx)("a",{className:"cursor-pointer text-xs font-medium text-blue-500",onClick:()=>{(0,eg.yr)(t.noteImportErrors,"errors.csv")},children:"Download CSV of errors"})]})})]})]})}),(0,r.jsx)("li",{children:(0,r.jsxs)("div",{className:"relative pb-8",children:[(0,r.jsx)("span",{className:"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"relative flex space-x-3",children:[(0,r.jsx)("div",{children:t.duplicateCount>0?(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-yellow-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(eo.Z,{className:"h-5 w-5"})}):(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-green-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(ep.Z,{className:"h-5 w-5"})})}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center justify-between space-x-4",children:[(0,r.jsx)("div",{className:"flex min-w-0 flex-1 items-center justify-between space-x-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-1 text-sm text-gray-500 dark:text-near-white",children:[(0,r.jsxs)("span",{children:["Ignored"," ",(0,r.jsxs)("span",{className:"font-medium text-gray-900 dark:text-white",children:[t.duplicateCount.toLocaleStr
1ing()," duplicate"]})," ","notes"]}),(0,r.jsx)(eu.u,{label:"We skip notes that are already in your database. To re-import duplicates, please create a new graph.",children:(0,r.jsx)(q.Z,{width:15,height:15})})]})}),(0,r.jsx)("div",{children:t.duplicateCount>0&&(0,r.jsx)("a",{className:"cursor-pointer text-xs font-medium text-blue-500",onClick:()=>{let e=t.duplicateImportNotes.map(e=>{var t,s;return{noteId:null!==(t=e.id)&&void 0!==t?t:"",noteSubject:null!==(s=e.subject)&&void 0!==s?s:""}});(0,eg.yr)(e,"duplicates.csv")},children:"Download CSV of duplicates"})})]})]})]})}),(0,r.jsx)("li",{children:(0,r.jsx)("div",{className:"relative pb-8",children:(0,r.jsxs)("div",{className:"relative flex space-x-3",children:[(0,r.jsx)("div",{children:t.readyToImportCount>0?(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-green-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(ep.Z,{className:"h-5 w-5"})}):(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-red-400 text-white ring-8 ring-white dark:ring-black",children:(0,r.jsx)(eo.Z,{className:"h-5 w-5"})})}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 justify-between space-x-4 pt-1.5",children:(0,r.jsx)("div",{children:(0,r.jsxs)("p",{className:"text-sm text-gray-500 dark:text-near-white",children:["Ready to import"," ",(0,r.jsxs)("span",{className:"font-medium text-gray-900 dark:text-white",children:[t.readyToImportCount.toLocaleString()," notes"]})]})})})]})})})]})})}),ej=(0,a.Pi)(e=>{let{view:t}=e;return(0,r.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,r.jsxs)("div",{className:"space-y-2 text-center text-bluegray-900 dark:text-near-white",children:[(0,r.jsx)("h2",{className:"text-lg",children:"Preparing for import"}),(0,r.jsxs)("h3",{className:"text-sm",children:["Processed ",t.processedCount.toLocaleString()," out of"," ",t.totalCount.toLocaleString()," notes..."]})]}),(0,r.jsx)("div",{className:"m-10 flex flex-none items-center justify-center",children:(0,r.jsx)(ex,{className:"h-8 w-8"})})]})})}),ey=(0,a.Pi)(e=>{let{view:t}=e;return(0,r.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center space-x-3",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-red-400 text-white ring-8 ring-white",children:(0,r.jsx)(eo.Z,{className:"h-5 w-5"})}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 items-center justify-between space-x-4",children:(0,r.jsx)("h2",{className:"text-lg text-red-400",children:"Import Error"})})]}),(0,r.jsxs)("div",{className:"mt-5 max-w-[40vh] space-y-2 text-center",children:[(0,r.jsx)("h2",{className:"text-bluegray-900 dark:text-near-white",children:"An error occurred while preparing the import. Are you sure you selected the right format?"}),t.errorMessage&&(0,r.jsxs)("p",{className:"text-sm text-gray-500 dark:text-near-black",children:["Error message: ",t.errorMessage]})]})]})})}),ev=(0,a.Pi)(e=>{let{onClose:t,graph:s,files:a,format:l}=e,n=(0,i.useMemo)(()=>new el({graph:s,files:a,format:l}),[s,a,l]),o=()=>{n.cancelImport(),t()};return(0,i.useEffect)(()=>{(0,en.ZP)(()=>n.prepareImport())},[n]),(0,r.jsx)(E.o,{onClose:o,children:(0,r.jsx)("div",{className:"flex h-full w-full flex-col items-center justify-center",children:(0,r.jsxs)("div",{className:"flex min-w-[40ch] flex-col overflow-hidden rounded-2xl border border-bluegray-200 dark:border-bluegray-800",children:[(0,r.jsx)("header",{className:"flex-none border-b border-bluegray-200 bg-bluegray-50 px-10 py-4 dark:border-bluegray-800 dark:bg-bluegray-900",children:(0,r.jsxs)("h2",{className:"truncate text-center text-bluegray-800 dark:text-near-white",children:["Import into ",(0,r.jsx)("strong",{children:n.graph.name})]})}),(0,r.jsxs)("main",{className:"flex min-h-[320px] flex-none flex-col p-10",children:["graph_error"===n.state&&(0,r.jsx)(ec,{}),"preparing_error"===n.state&&(0,r.jsx)(ey,{view:n}),"preparing"===n.state&&(0,r.jsx)(ej,{view:n}),"prepared"===n.state&&(0,r.jsx)(ef,{view:n}),"importing"===n.state&&(0,r.jsx)(eh,{view:n}),"imported"===n.state&&(0,r.jsx)(em,{view:n,onClose:t})]}),"imported"!==n.state&&(0,r.jsxs)("footer",{className:"flex h-14 flex-none justify-between space-x-3 border-t border-bluegray-200 px-4 py-3 dark:border-bluegray-800",children:[(0,r.jsx)("a",{className:"inline-flex cursor-pointer items-center justify-center px-3 text-sm font-medium text-bluegray-500 dark:text-near-white",onClick:o,children:"Cancel"}),"prepared"===n.state&&(0,r.jsx)(z.KM,{onClick:()=>n.startImport(),disabled:0===n.readyToImportCount,children:"Start import"})]}),(0,r.jsx)("div",{className:"flex flex-none items-center border-t border-bluegray-200 px-4 py-2 dark:border-bluegray-800",children:(0,r.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://reflect.academy/import-export-backups",className:"inline-flex cursor-pointer space-x-2 text-xs text-bluegray-500 dark:text-bluegray-300",children:[(0,r.jsx)(q.Z,{width:15,height:15}),(0,r.jsx)("span",{children:"Learn about imports"})]})})]})})})}),eb=(0,a.Pi)(e=>{let{graph:t}=e,[s,a]=(0,i.useState)("reflect"),[l,n]=(0,i.useState)([]),o=Object.entries(H).map(e=>{var t;let[s,[r]]=e;return[s,null!==(t=r.description)&&void 0!==t?t:""]}),c=H[s];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h3",{className:"text-xl font-medium leading-7 text-gray-900 dark:text-near-white",children:"Import your notes"}),(0,r.jsx)("div",{className:"mt-6 sm:mt-5",children:(0,r.jsxs)("div",{className:"border-border sm:grid sm:grid-cols-4 sm:items-end sm:gap-4 sm:border-t sm:pt-5",children:[(0,r.jsx)("div",{className:"block text-gray-700 dark:text-near-white",children:(0,r.jsx)("div",{className:"max-w-44",children:(0,r.jsx)(A.P,{selectedValue:s,onChange:e=>a(e),label:"Select format",options:o})})}),(0,r.jsx)("div",{className:"mt-1 flex flex-col space-y-3 sm:col-span-2 sm:mt-0",children:(0,r.jsx)(J,{onChange:e=>n(e),acceptTypes:c,children:"Select import file(s)"})})]})})]}),l.length>0&&(0,r.jsx)(ev,{onClose:()=>n([]),graph:t,format:s,files:l})]})}),eN=(0,a.Pi)(()=>{let{selectedGraph:e}=(0,l.Jf)();return e?(0,r.jsxs)("div",{className:"space-y-12 px-10 py-10","data-testid":"preferences-graph",children:[(0,r.jsx)(F,{graph:e}),(0,r.jsx)(eb,{graph:e}),(0,r.jsx)(V,{graph:e}),(0,r.jsx)(p,{graph:e}),(0,r.jsx)(v,{graph:e})]}):null})},95960:function(e,t,s){s.d(t,{d:function(){return c}});var r=s(11527),a=s(44838),i=s(22552),l=s(63320),n=s(73419),o=s(95117);let c=e=>(0,l.W)()?(0,r.jsx)(d,{...e}):(0,r.jsx)(m,{...e}),d=e=>{let{onFocus:t,...s}=e,l=(0,i.ze)(),c=(0,o.L)(),d=async e=>{let t=null==c?void 0:c.current,s=e.target.getBoundingClientRect();await (0,a.when)(()=>"exact"===l.keyboardHeight.type),await (0,n.Z)(100);let r=window.innerHeight-l.keyboardHeight.value,i=s.bottom+75-r;i>0&&(null==t||t.scrollBy({top:i,behavior:"smooth"}))};return(0,r.jsx)("input",{...s,onFocus:e=>{d(e),null==t||t(e)}})},m=e=>(0,r.jsx)("input",{...e})},5955:function(e,t,s){s.d(t,{W:function(){return c}});var r=s(11527),a=s(58222),i=s(59124),l=s(4814),n=s(50959),o=s(95960);let c=e=>{let{value:t,onChange:s,error:c=!1,autoFocus:d,autoComplete:m,disabled:x}
1=e,[h,p]=(0,n.useState)(!1);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{title:"Toggle input plaintext",onClick:()=>p(!h),className:"absolute inset-y-0 left-0 flex cursor-pointer items-center pl-3 text-gray-300 hover:text-gray-400",children:h?(0,r.jsx)(a.Z,{width:20,height:20}):(0,r.jsx)(i.Z,{width:20,height:20})}),(0,r.jsx)(o.d,{type:h?"input":"password",autoComplete:m,value:t,onChange:e=>s(e.target.value),required:!0,autoFocus:d,minLength:5,disabled:x,className:(0,l.Z)("block w-full rounded-md border border-coolgray-900/15 px-10 py-2 text-sm text-black shadow-app-input shadow-black/2 outline-none transition-all duration-300 focus:border-purple-300 focus:ring focus:ring-purple-200/50 dark:border-gray-800 dark:bg-gray-900 dark:text-white dark:focus:border-purple-600 dark:focus:ring-purple-900/50",c&&"border-red-300 text-red-900 placeholder-red-300 focus:border-red-500 focus:outline-none focus:ring-red-500",x&&"cursor-not-allowed")})]})})}},55044:function(e,t,s){s.d(t,{P:function(){return c}});var r=s(11527),a=s(36923),i=s(21096),l=s(63415);s(50959);var n=s(4814);let o=e=>{let{label:t,value:s}=e;return(0,r.jsx)(a.R.Option,{value:s,children:e=>{let{selected:s,active:a}=e;return(0,r.jsx)("div",{className:(0,n.Z)(s?"text-primary dark:text-primary-dk":"text-coolgray-900 dark:text-near-white",a?"bg-coolgray-100 dark:bg-white/3 dark:text-white":"","relative cursor-pointer select-none rounded-md py-2 px-3 text-2xs leading-none"),title:t,children:(0,r.jsx)("span",{className:"".concat(s?"font-medium":"font-normal"," block truncate"),children:t})})}},s)},c=e=>{let{label:t,selectedValue:s,options:n,onChange:c,className:d=""}=e,[,m]=n.find(e=>{let[t]=e;return t===s})||[];return(0,r.jsx)(a.R,{as:"div",className:"space-y-1 ".concat(d),value:s,onChange:e=>c(e),children:e=>{let{open:s}=e;return(0,r.jsxs)(r.Fragment,{children:[t&&(0,r.jsx)(a.R.Label,{className:"block text-2xs font-medium leading-5 text-coolgray-700 dark:text-near-white",children:t}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)(a.R.Button,{className:"relative w-full cursor-default rounded-md border border-coolgray-900/15 bg-white py-2 px-3.5 pr-10 text-left text-sm shadow-app-input shadow-black/5 outline-none dark:border-gray-800 dark:bg-gray-900",children:[(0,r.jsx)("span",{className:"block truncate",children:m}),(0,r.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:(0,r.jsx)(l.Z,{className:"h-5 w-5 text-coolgray-400"})})]}),(0,r.jsx)(i.u,{show:s,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",className:"absolute z-popover mt-1 w-full rounded-md bg-white shadow-lg",children:(0,r.jsx)(a.R.Options,{static:!0,className:"max-h-60 overflow-auto rounded-md py-1 px-1 text-2xs leading-6 shadow-sm ring-1 ring-coolgray-900/10 focus:outline-none dark:bg-gray-900 dark:ring-gray-800",children:n.map(e=>{let[t,s]=e;return(0,r.jsx)(o,{value:t,label:s},t)})})})]})]})}})}},88338:function(e,t,s){s.d(t,{D:function(){return a}});var r=s(22402);function a(e){let{content:t,filename:s}=function(e){let t=JSON.stringify(e);return{filename:"reflect-recovery-kit-".concat(e.graphId,".json"),content:t}}(e),a=new Blob([t],{type:"text/json"});(0,r.l)(a,s)}},719:function(e,t,s){s.d(t,{_H:function(){return l},w4:function(){return o},y1:function(){return n}});var r=s(63593),a=s(22402),i=s(4038);async function l(e){let{graphId:t}=e,s=await (0,i.Le)({graphId:t,create:!1});if(!s)return[];let a=await (0,i.Zj)(s);return(0,r.Z)(a).reverse()}async function n(){let e=await (0,i.pQ)({create:!1});if(!e)return[];let t=[];for await(let[s,a]of e.entries()){if("directory"!==a.kind)continue;let e=await (0,i.Zj)(a);t.push({graphId:s,backups:(0,r.Z)(e).reverse()})}return(0,r.Z)(t,"graphId")}async function o(e){let{graphId:t,backup:s}=e,r=await (0,i.Le)({graphId:t,create:!1});if(!r)return;let l=await r.getFileHandle(s),n=await l.getFile();(0,a.l)(n,s)}}}]);

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.