PageSourceSearch

https://mymori.ai/assets/m-D71YAKHZ.js

js mymori.ai collected 2026-10-05 14:02:20 UTC 6,211 bytes, 1 lines download raw bytes

1import{v,aQ as N,r as n,s as f,N as j,j as e,S as w,C as u,c as m,B as g,ac as p,D as y,a as b,b as C,k as o,ab as _,Y as k,a4 as q}from"./m-D-MmE8SN.js";import{f as E}from"./m-CjpixGe9.js";import{f as M}from"./m-l-ZvcBP_.js";import"./m-dJpGZx7y.js";import"./m-WIUbhdUx.js";import"./m-CujOUmFp.js";const A=v("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),B=()=>{const{user:t}=N(),[c,i]=n.useState([]),[x,s]=n.useState(!0),[r,h]=n.useState(!1),l=n.useCallback(async()=>{if(!t)return;s(!0);const{data:a,error:d}=await f.from("patient_egress_exports").select("*").eq("user_id",t.id).order("requested_at",{ascending:!1}).limit(20);d||i(a??[]),s(!1)},[t]);return n.useEffect(()=>{l()},[l]),{exports:c,loading:x,requesting:r,requestExport:async()=>{if(!t)return null;h(!0);try{const{data:a,error:d}=await f.functions.invoke("patient-egress-export",{body:{}});if(d)throw d;return j.success("Your continuity bundle is ready",{description:`${a.record_count} records · signed & verifiable`}),await l(),a}catch(a){return console.error("[usePatientEgress] export failed:",a),j.error("Export failed",{description:a instanceof Error?a.message:"Unknown error"}),null}finally{h(!1)}},refresh:l}},D=t=>t?t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(2)} MB`:"—",G=()=>{const{exports:t,loading:c,requesting:i,requestExport:x}=B();return e.jsxs("div",{className:"container mx-auto max-w-3xl p-4 md:p-8 space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[e.jsx(w,{className:"w-5 h-5"}),e.jsx("span",{className:"text-xs uppercase tracking-wide font-semibold",children:"Your data, your ownership"})]}),e.jsx("h1",{className:"text-3xl font-bold",children:"My Continuity Bundle"}),e.jsx("p",{className:"text-muted-foreground",children:"Download a complete, signed copy of everything Mori holds for you — your consent ledger, directives, continuity signals, and proof receipts. The bundle is portable to any other ACI-compliant provider."})]}),e.jsx(u,{className:"border-primary/20 bg-primary/5",children:e.jsx(m,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"font-semibold",children:"Generate a new bundle"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"The export typically takes a few seconds. Bundles are HMAC-signed and the download link is valid for 7 days."})]}),e.jsx(g,{onClick:x,disabled:i,size:"lg",children:i?e.jsxs(e.Fragment,{children:[e.jsx(p,{className:"w-4 h-4 mr-2 animate-spin"})," Generating…"]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-2"})," Generate bundle"]})})]})})}),e.jsxs(u,{children:[e.jsx(b,{children:e.jsx(C,{className:"text-base",children:"Past exports"})}),e.jsx(m,{className:"space-y-3",children:c?e.jsx("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:e.jsx(p,{className:"w-5 h-5 animate-spin"})}):t.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground text-sm",children:"No exports yet. Generate one above."}):t.map(s=>{const r=s.expires_at&&new Date(s.expires_at)<new Date;return e.jsxs("div",{className:"flex items-start justify-between gap-3 p-4 rounded-lg border bg-card",children:[e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"font-mono text-xs text-muted-foreground truncate",children:s.id.slice(0,8)}),s.status==="completed"&&!r&&e.jsxs(o,{variant:"outline",className:"border-primary/40 text-primary",children:[e.jsx(_,{className:"w-3 h-3 mr-1"})," Ready"]}),r&&e.jsxs(o,{variant:"outline",className:"text-muted-foreground",children:[e.jsx(k,{className:"w-3 h-3 mr-1"})," Expired"]}),s.status==="failed"&&e.jsxs(o,{variant:"outline",className:"border-destructive/40 text-destructive",children:[e.jsx(q,{className:"w-3 h-3 mr-1"})," Failed"]}),(s.status==="pending"||s.status==="processing")&&e.jsxs(o,{variant:"outline",children:[e.jsx(p,{className:"w-3 h-3 mr-1 animate-spin"})," ",s.status]})]}),e.jsxs("div",{className:"text-sm",children:[s.record_count??0," records · ",D(s.bundle_size_bytes)]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[E(new Date(s.requested_at),"PP p")," ·"," ",M(new Date(s.requested_at),{addSuffix:!0})]}),s.bundle_signature&&e.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground truncate",children:["sig: ",s.bundle_signature.slice(0,32),"…"]}),s.error_message&&e.jsx("div",{className:"text-xs text-destructive mt-1",children:s.error_message})]}),s.status==="completed"&&s.bundle_url&&!r&&e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsxs("a",{href:s.bundle_url,download:`mori-bundle-${s.id.slice(0,8)}.json`,children:[e.jsx(y,{className:"w-4 h-4 mr-1"})," Download"]})})]},s.id)})})]}),e.jsx(u,{className:"bg-muted/30",children:e.jsxs(m,{className:"pt-6 text-sm text-muted-foreground space-y-2",children:[e.jsx("p",{className:"font-semibold text-foreground",children:"What's in the bundle?"}),e.jsxs("ul",{className:"space-y-1 list-disc list-inside ml-2",children:[e.jsx("li",{children:"Profile and identity metadata"}),e.jsx("li",{children:"Full unified consent ledger (every grant, every revocation)"}),e.jsx("li",{children:"Active directives (POA, healthcare proxy, advance directive metadata)"}),e.jsx("li",{children:"Continuity signals delivered on your behalf"}),e.jsx("li",{children:"Cryptographic receipts proving every signal Mori issued"})]}),e.jsxs("p",{className:"pt-2",children:["The bundle uses Mori's open ",e.jsx("code",{className:"text-xs",children:"portable-v1"})," schema, HMAC-SHA256 signed. Any other ACI-compliant platform can import it."]})]})})]})};export{G 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.