PageSourceSearch

https://classmate-vuive.com/assets/MindmapHistory-e3218fe6.js

js classmate-vuive.com collected 2026-10-08 16:08:16 UTC 30,370 bytes, 26 lines download raw bytes

1import{h as $,Q as Xe,b as Ke,i as Ze,f as et,a as r,j as e,F as tt,m as A,S as Se}from"./index-7a84a097.js";import{l as at,r as g,a as rt}from"./vendor-56877fa0.js";import{u as ke}from"./CheckPermissions-afd20e60.js";import{F as Ce}from"./data-f4081293.js";import{c as S}from"./cn-39d6bbce.js";import{c as Y}from"./string-281a6a65.js";import{L as st}from"./layout-list-9d6a986a.js";import{L as it}from"./layout-grid-14d32570.js";import{R as ot}from"./refresh-cw-1e477dcd.js";import{S as Ee}from"./search-ae40e1da.js";import{S as F}from"./star-c42f6093.js";import{C as R}from"./clock-06681489.js";import{C as W}from"./circle-check-0b5deb42.js";import{M as X}from"./mail-b4c3be00.js";import{S as K}from"./share-2-6db8fb60.js";import{S as Z}from"./square-pen-a2723bdc.js";import{T as ee}from"./trash-7e8954d6.js";import{C as nt}from"./chevron-left-96e037a7.js";import{C as lt}from"./chevron-right-699598bb.js";import{A as ct}from"./arrow-left-3cbec197.js";import{F as dt}from"./folder-43a63f99.js";import{X as Me}from"./x-f4d47a47.js";import{I as Be}from"./info-7ea2c597.js";const j=Xe;async function mt(n,l,m){try{const d=await $(n,{query:`
2      query GetMindmapsByEmail($email: String!, $domain: String!) {
3        getMindmapsByEmail(email: $email, domain: $domain) {
4          status
5          data {
6            id
7            email
8            title
9            tags
10            createdAt
11            updatedAt
12            score
13            presentation {
14              slideNumber
15              content
16            }
17          }
18        }
19      }
20    `,variables:{email:l,domain:m}});if(d&&d.getMindmapsByEmail)return d.getMindmapsByEmail}catch(s){return console.error("Error fetching mindmaps:",s),s}}async function te(n,l,m){try{const s={query:j.getMindmapById,variables:{id:l,domain:m}},c=await $(n,s);if(c&&c.getMindmapById)return c.getMindmapById}catch(s){return console.error("Error fetching mindmap by ID:",s),s}}async function gt(n,l,m){try{const s={query:j.getMindmapsByCheckBy,variables:{checkBy:l,domain:m}},c=await $(n,s);if(c&&c.getMindmapsByCheckBy)return c.getMindmapsByCheckBy}catch(s){return console.error("Error fetching mindmaps by checkBy:",s),s}}async function Qt(n,l,m,s){try{const c={query:j.createOrUpdateMindmap,variables:{mindmap:l,isEdit:m,domain:s}},d=await $(n,c);if(d&&d.createOrUpdateMindmap)return d.createOrUpdateMindmap}catch(c){return console.error("Error creating or updating mindmap:",c),c}}async function ut(n,l,m){try{const s={query:j.deleteMindmap,variables:{id:l,domain:m}},c=await $(n,s);if(c&&c.deleteMindmap)return c.deleteMindmap}catch(s){return console.error("Error deleting mindmap:",s),s}}const ht="MindmapCacheDB",pt=1,N="mindmapCache",ft=5*60*1e3,U=()=>new Promise((n,l)=>{const m=indexedDB.open(ht,pt);m.onerror=()=>l(m.error),m.onsuccess=()=>n(m.result),m.onupgradeneeded=s=>{const c=s.target.result;if(!c.objectStoreNames.contains(N)){const d=c.createObjectStore(N,{keyPath:"key"});d.createIndex("key","key",{unique:!0}),d.createIndex("timestamp","timestamp",{unique:!1})}}}),yt=async(n,l)=>{try{const m=await U(),c=m.transaction([N],"readwrite").objectStore(N),d={key:n,data:l,timestamp:Date.now()};await new Promise((p,b)=>{const h=c.put(d);h.onsuccess=()=>p(h.result),h.onerror=()=>b(h.error)}),m.close(),console.log(`Mindmaps cached with key: ${n}`)}catch(m){throw console.error("Error saving mindmaps to cache:",m),m}},xt=async n=>{try{const l=await U(),s=l.transaction([N],"readonly").objectStore(N),c=await new Promise((p,b)=>{const h=s.get(n);h.onsuccess=()=>p(h.result),h.onerror=()=>b(h.error)});return l.close(),c?Date.now()-c.timestamp>ft?(console.log(`Cache expired for key: ${n}`),await ze(n),null):(console.log(`Cache hit for key: ${n}`),c.data):null}catch(l){return console.error("Error getting mindmaps from cache:",l),null}},ze=async n=>{try{const l=await U(),s=l.transaction([N],"readwrite").objectStore(N);await new Promise((c,d)=>{const p=s.delete(n);p.onsuccess=()=>c(p.result),p.onerror=()=>d(p.error)}),l.close(),console.log(`Cache cleared for key: ${n}`)}catch(l){console.error("Error removing mindmaps from cache:",l)}},bt=async n=>{try{const l=await U(),s=l.transaction([N],"readwrite").objectStore(N),d=(await new Promise((p,b)=>{const h=s.getAll();h.onsuccess=()=>p(h.result),h.onerror=()=>b(h.error)})).filter(p=>p.key.includes(n)).map(p=>new Promise((b,h)=>{const w=s.delete(p.key);w.onsuccess=()=>b(),w.onerror=()=>h(w.error)}));await Promise.all(d),l.close(),console.log(`Cache invalidated for user: ${n}`)}catch(l){console.error("Error invalidating user cache:",l)}},Ie=(n,l="all")=>`mindmaps_${n}_${l}`,ae=n=>{const l=new Date(n);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(l)},vt=({isInTab:n=!1,isSummary:l=!1,onMindmapSelected:m=null})=>{const s=Ke(t=>t.user.user),{siteSettings:c}=Ze(s),{showAlert:d}=et(),p=at(),b=ke(s,Ce.PREMIUM_FEATURES),[h,w]=g.useState([]),[re,T]=g.useState(!0),[B,se]=g.useState(1),[L,ie]=g.useState(!1),[P,Ae]=g.useState("desc"),[k,oe]=g.useState(""),[E,Te]=g.useState([]);g.useState(!1);const[Nt,Pe]=g.useState([]),[ne,le]=g.useState(null),[q,ce]=g.useState(null),[x,de]=g.useState("all"),$e=ke(s,Ce.PREMIUM_FEATURES),[De,me]=g.useState(!1),[ge,Fe]=g.useState(()=>localStorage.getItem("hideHistoryGuide")==="true"),[I,Re]=g.useState(()=>localStorage.getItem("mindmap-history-view-mode")||"folder"),[O,ue]=g.useState(!1),[je,he]=g.useState(!1);g.useEffect(()=>{x==="history"&&localStorage.setItem("mindmap-history-view-mode",I)},[I,x]);const[_,H]=g.useState(null),[wt,pe]=g.useState(null),G=10;g.useEffect(()=>{if(h.length>0){const t=h.reduce((o,y)=>y.tags&&Array.isArray(y.tags)?[...o,...y.tags]:o,[]),a={};t.forEach(o=>{a[o]=(a[o]||0)+1});const i=Object.keys(a).map(o=>({name:o,count:a[o]}));i.sort((o,y)=>y.count-o.count),Pe(i)}}
20,[h]);const M=h.filter(t=>{const a=!k.trim()||(t.title||"Untitled Mindmap").toLowerCase().includes(k.toLowerCase().trim()),i=E.length===0||t.tags&&E.every(o=>t.tags.includes(o));return a&&i}),D=Math.ceil(M.length/G);g.useEffect(()=>{se(1)},[k,E]);const fe=B*G,Ue=fe-G,Le=M.slice(Ue,fe),qe=t=>{oe(t.target.value)},ye=()=>{oe("")},Oe=()=>{Te([])},xe=async(t=!1)=>{if(!s){T(!1);return}T(!0),pe(null),he(!1);try{const a=Ie(s.email,x);if(!t){const o=await xt(a);if(o){console.log("Using cached mindmaps data"),he(!0);let y=[...o];y.sort((f,u)=>{const v=new Date(f.createdAt||0),C=new Date(u.createdAt||0);return P==="desc"?C-v:v-C}),w(y),T(!1);return}}let i;if(x==="evaluated"){if(!b){w([]),T(!1);return}i=await gt(s,s.email,A),i&&i.status===200&&i.data&&(i.data=i.data.filter(o=>o.email!==o.checkBy))}else i=await mt(s,s.email,A),console.log(i);if(i&&i.status===200&&i.data){let o=[...i.data];o.sort((f,u)=>{const v=new Date(f.createdAt||0),C=new Date(u.createdAt||0);return P==="desc"?C-v:v-C});const y=o.map(f=>({...f,formattedScore:f.score}));w(y);try{await yt(a,y)}catch(f){console.warn("Failed to cache mindmaps:",f)}}else w([])}catch(a){console.error("Error fetching mindmaps:",a),d("error",`Error loading mindmaps: ${a.message}`),pe("An error occurred while loading mindmaps")}finally{T(!1)}},_e=async()=>{ue(!0),await xe(!0),ue(!1)};g.useEffect(()=>{xe()},[s,b,P,x]),g.useEffect(()=>{const t=localStorage.getItem("previousActiveTab");if(t&&t!==x){const a=Ie((s==null?void 0:s.email)||"",t);ze(a).catch(console.warn)}localStorage.setItem("previousActiveTab",x)},[x,s==null?void 0:s.email]);const be=t=>{t<1||t>D||se(t)},He=()=>{Ae(P==="desc"?"asc":"desc")},Q=async t=>{if(confirm("Are you sure you want to delete this mindmap? This action cannot be undone.")){ie(!0);try{const a=await ut(s,t,A);if(a&&a.status===200){const i=localStorage.getItem("mindmap");if(i)try{JSON.parse(i).mindmapId===t&&(localStorage.removeItem("mindmap"),localStorage.removeItem("mindmap-title"),localStorage.removeItem("mindmap-tags"))}catch(o){console.error("Error parsing localStorage mindmap:",o)}d("success","Mindmap deleted successfully"),w(h.filter(o=>o.id!==t));try{await bt(s.email)}catch(o){console.warn("Failed to invalidate cache:",o)}p("/mindmap?tab=history")}else d("error",`Failed to delete mindmap: ${(a==null?void 0:a.message)||"Unknown error"}`)}catch(a){console.error("Error deleting mindmap:",a),d("error",`Error deleting mindmap: ${a.message}`)}finally{ie(!1)}}},z=async t=>{var a,i,o,y;try{if(m){m(t);return}le(t.id);try{const f=await te(s,t.id,A);if(f&&f.status===200&&f.data){const u=f.data;localStorage.removeItem("mindmap"),localStorage.removeItem("mindmap-title"),localStorage.removeItem("mindmap-tags"),localStorage.removeItem("mindmap-source"),localStorage.removeItem("mindmap-evaluation-mode"),localStorage.removeItem("mindmap-evaluation-id"),localStorage.removeItem("mindmap-evaluation-data"),localStorage.removeItem("mindmap-evaluation-status");const v=x==="evaluated"&&t.checkBy,C=u.email===s.email;localStorage.setItem("mindmap",JSON.stringify({rootNode:(a=u.data)==null?void 0:a.rootNode,nextId:((i=u.data)==null?void 0:i.nextId)||100,fontSize:((o=u.data)==null?void 0:o.fontSize)||1,bgColor:((y=u.data)==null?void 0:y.bgColor)||"purpleGradient",mindmapId:u.id})),localStorage.setItem("mindmap-title",u.title||""),u.tags&&localStorage.setItem("mindmap-tags",JSON.stringify(u.tags)),localStorage.setItem("mindmap-source",u.source||""),v&&(localStorage.setItem("mindmap-evaluation-mode","true"),localStorage.setItem("mindmap-evaluation-id",u.id));const we=u.title?Y(u.title):"untitled";n?p("/mindmap",{state:{initialData:{...u,email:u.email},fromHistory:!0,isEvaluationMode:v,sourceTab:!0}}):p(C?`/mindmap/${we}?id=${u.id}&tab=source`:`/mindmap/preview/${we}?id=${u.id}`)}else throw new Error("Failed to load mindmap")}catch(f){console.error("Error loading mindmap:",f),d("Error loading mindmap","error")}}catch(f){console.error("Error in handleLoadMindmap:",f),d("Error loading mindmap","error")}finally{le(null)}},Ge=()=>{p("/mindmap")},V=async t=>{try{const a=await te(s,t,A);if(a&&a.status===200&&a.data){const i=Y(a.data.title||"untitled-mindmap"),o=`https://${Se.MAIN_URL}/mindmap/${i}?id=${t}`;await navigator.clipboard.writeText(o),ce(t),d("success","Share link copied to clipboard!"),setTimeout(()=>{ce(null)},2e3)}else d("error","Failed to get mindmap data")}catch{d("error","Failed to copy share link")}},J=async t=>{try{const a=await te(s,t.id,A);if(a&&a.status===200&&a.data){const i=Y(a.data.title||"untitled-mindmap"),o=`https://${Se.MAIN_URL}/mindmap/${i}?id=${t.id}&tab=source`;let y="";t.checkBy&&(y=t.checkBy===s.email?t.email:t.checkBy);const f=encodeURIComponent(`Mindmap: ${a.data.title||"Untitled Mindmap"}`),u=encodeURIComponent(`Hi,
21
22I'd like to share this mindmap with you:
23${o}
24
25Best regards,
26${s.email}`),v=`https://mail.google.com/mail/?view=cm&fs=1&to=${y}&su=${f}&body=${u}`;window.open(v,"_blank")}else d("error","Failed to get mindmap data")}catch{d("error","Failed to prepare email")}};g.useEffect(()=>{const t=new URL(window.location.href);n&&t.searchParams.get("showGuide")==="true"&&!ge&&(setTimeout(()=>{me(!0)},800),t.searchParams.delete("showGuide"),window.history.replaceState({},"",t))},[n,ge]);const Qe=()=>{Fe(!0),localStorage.setItem("hideHistoryGuide","true")},Ve=({onClose:t,onHideForever:a})=>rt.createPortal(r("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",children:[e("div",{className:"fixed inset-0 bg-black/50",onClick:t}),r("div",{className:"relative bg-white rounded-xl shadow-xl p-6 w-[500px] max-w-[90vw] animate-in zoom-in-95 duration-200",children:[e("button",{onClick:t,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700",children:e(Me,{size:20})}),r("div",{className:"flex flex-col items-center text-center mb-6",children:[e("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:e(Be,{className:"w-8 h-8 text-blue-600"})}
26),e("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Mindmap Đã Lưu"}),e("p",{className:"text-gray-600",children:"Tuyệt vời! Bạn đã lưu mindmap thành công! Đây là những việc bạn có thể làm tiếp theo:"})]}),e("div",{className:"mb-6 text-gray-600",children:r("ol",{className:"list-decimal pl-5 space-y-3 text-left",children:[e("li",{className:"font-medium",children:"Nhấp vào mindmap vừa lưu trong danh sách bên dưới."}),r("li",{children:["Khi vào mindmap, tìm nút"," ",e("span",{className:"font-medium",children:"Review knowledge"})," trên thanh công cụ."]}),r("li",{children:["Chọn ",e("span",{className:"font-medium",children:"Tạo Quiz"})," từ các tùy chọn Review knowledge để tạo câu hỏi trắc nghiệm dựa trên nội dung mindmap của bạn."]})]})}),r("div",{className:"flex items-center justify-between",children:[r("label",{className:"flex items-center text-sm text-gray-600",children:[e("input",{type:"checkbox",className:"form-checkbox h-4 w-4 text-indigo-600 rounded border-gray-300 focus:ring-indigo-500",onChange:i=>{i.target.checked&&a()}}),e("span",{className:"ml-2",children:"Không hiện lại"})]}),r("div",{className:"flex gap-3",children:[e("button",{onClick:t,className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors text-sm",children:"Để sau"}),e("button",{onClick:()=>{t()},className:"px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors text-sm",children:"Đã hiểu"})]})]})]})]}),document.body),ve=g.useMemo(()=>{const t={};return M.forEach(a=>{a.tags&&a.tags.length>
260?a.tags.forEach(i=>{t[i]||(t[i]=[]),t[i].push(a)}):(t.uncategorized||(t.uncategorized=[]),t.uncategorized.push(a))}),t},[M]),Je=t=>{H(t)},Ye=()=>{H(null)},We=()=>{if(_){const t=ve[_]||[];return r("div",{children:[r("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[r("button",{onClick:Ye,className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors",children:[e(ct,{size:20}),e("span",{children:"Back to Folders"})]}),e("span",{className:"text-gray-400",children:"/"}),r("span",{className:"font-medium text-gray-900",children:["#",_]}),r("span",{className:"text-sm text-gray-500",children:["(",t.length," mindmaps)"]})]}),e("div",{className:"grid grid-cols-1 gap-4",children:t.map(a=>e("div",{className:"bg-white rounded-lg border border-gray-200 p-4 hover:border-indigo-300 transition-colors",children:r("div",{className:"flex justify-between items-start flex-wrap flex-col sm:flex-row gap-2",children:[r("div",{className:"flex-1",children:[e("h3",{onClick:()=>z(a),className:"text-left text-lg font-medium text-indigo-600 hover:text-indigo-800 cursor-pointer mb-2",children:a.title||"Untitled Mindmap"}),a.score!==null&&a.score!==void 0&&r("div",{className:"flex items-center gap-2 text-sm text-amber-600 mb-2",children:[e(F,{size:14,className:"shrink-0"}),r("span",{className:"truncate",children:["Score: ",a.score]})]}),r("div",{className:"flex flex-col gap-1",children:[r("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[e(R,{size:14}),ae(a.createdAt)]}),a.checkBy&&r("div",{className:"flex items-center gap-2 text-sm text-emerald-600",children:[e(W,{size:14,className:"shrink-0"}),e("span",{className:"truncate",children:a.checkBy===s.email?`Author: ${a.email}`:"Evaluated"})]})]})]}),r("div",{className:"flex items-center gap-2",children:[e("button",{onClick:()=>J(a),className:"p-2 rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors","aria-label":a.checkBy?a.checkBy===s.email?"Email to author":"Email to evaluator":"Share via email",title:a.checkBy?a.checkBy===s.email?"Email to author":"Email to evaluator":"Share via email",children:e(X,{size:18})}),e("button",{onClick:()=>V(a.id),className:S("p-2 rounded-lg transition-all duration-200",q===a.id?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"),"aria-label":"Share mindmap",children:e(K,{size:18})}),e("button",{onClick:()=>z(a),className:"p-2 rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors","aria-label":"Edit mindmap",children:e(Z,{size:18})}),x!=="evaluated"&&e("button",{onClick:()=>Q(a.id),disabled:L,className:"p-2 rounded-lg bg-gray-100 text-red-600 hover:bg-red-50 transition-colors disabled:opacity-50","aria-label":"Delete mindmap",children:e(ee,{size:18})})]})]})},a.id))})]})}return e("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Object.entries(ve).map(([t,a])=>e("button",{onClick:()=>Je(t),className:"flex flex-col p-6 bg-white rounded-lg border border-gray-200 hover:border-indigo-300 hover:shadow-sm transition-all group",children:r("div",{className:"flex items-center gap-3 mb-3",children:[e("div",{className:"w-12 h-12 flex items-center justify-center rounded-full bg-indigo-50 text-indigo-600 group-hover:bg-indigo-100 transition-colors shrink-0",children:e(dt,{size:24})}),r("div",{className:"flex flex-col items-start",children:[r("h3",{className:"font-medium text-gray-900 text-left",children:["#",t]}),r("p",{className:"text-sm text-gray-500",children:[a.length," mindmaps"]})]})]})},t))})},Ne=t=>{Re(t),H(null)};return s?!b&&x==="evaluated"?r("div",{className:"flex flex-col items-center justify-center h-[60vh] text-center p-4",children:[e("div",{className:"text-amber-600 mb-6",children:r("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-16 w-16 mx-auto",viewBox:"0 0 20 20",fill:"currentColor",children:[e("path",{fillRule:"evenodd",d:"M10 2a8 8 0 100 16 8 8 0 000-16zm0 14a6 6 0 110-12 6 6 0 010 12z",clipRule:"evenodd"}),e("path",{fillRule:"evenodd",d:"M10 5a1 1 0 011 1v4a1 1 0 01-2 0V6a1 1 0 011-1z",clipRule:"evenodd"}),e("path",{fillRule:"evenodd",d:"M10 12a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})]})}
26),e("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:"Premium Feature"}),e("p",{className:"text-gray-600 mb-6 max-w-md",children:"Evaluating mindmaps is a premium feature. Upgrade to premium to access this and many more features."}),r("div",{className:"flex flex-col sm:flex-row gap-3",children:[e("button",{className:"px-6 py-3 bg-gradient-to-r from-purple-600 to-indigo-600 text-white font-medium rounded-md hover:from-purple-700 hover:to-indigo-700 transition-colors shadow-md",onClick:()=>window.open((c==null?void 0:c.landingPage)||"","_blank"),children:"Upgrade to Premium"}),e("button",{className:"px-6 py-3 bg-gray-200 text-gray-800 font-medium rounded-md hover:bg-gray-300 transition-colors",onClick:Ge,children:"Back to Mindmap"})]})]}):r("div",{className:"container mx-auto max-w-7xl",children:[r("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[r("div",{className:"space-y-6",children:[r("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e("div",{className:"bg-gray-100 rounded-lg p-1",children:r("div",{className:"flex space-x-1",children:[e("button",{onClick:()=>de("all"),className:S("px-4 py-2 text-sm font-medium rounded-md transition-colors",x==="all"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"),children:"All Mindmaps"}),$e&&e("button",{onClick:()=>de("evaluated"),className:S("px-4 py-2 text-sm font-medium rounded-md transition-colors",x==="evaluated"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"),children:"Evaluated"})]})}),r("div",{className:"flex flex-wrap items-center gap-2",children:[e("div",{className:"bg-gray-100 rounded-lg p-1",children:r("div",{className:"flex space-x-1",children:[e("button",{onClick:()=>Ne("list"),className:S("p-2 text-sm font-medium rounded-md transition-colors",I==="list"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"),"aria-label":"List view",children:e(st,{size:18})}),e("button",{onClick:()=>Ne("folder"),className:S("p-2 text-sm font-medium rounded-md transition-colors",I==="folder"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"),"aria-label":"Folder view",children:e(it,{size:18})})]})}),r("button",{onClick:_e,disabled:O,className:S("flex items-center justify-center gap-1.5 px-3 py-2 rounded-md text-sm transition-colors",O?"bg-gray-200 text-gray-500 cursor-not-allowed":"bg-blue-100 text-blue-700 hover:bg-blue-200"),title:"Refresh data from server",children:[e(
26ot,{size:16,className:S(O&&"animate-spin")}),e("span",{children:"Refresh"})]}),r("button",{onClick:He,className:"flex items-center justify-center gap-1.5 px-3 py-2 bg-gray-100 rounded-md text-sm text-gray-700 hover:bg-gray-200 transition-colors",children:[e(R,{size:16}),e("span",{children:P==="desc"?"Newest First":"Oldest First"})]})]})]}),I==="list"&&r("div",{className:"relative",children:[e("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-500",children:e(Ee,{size:16})}),e("input",{type:"text",value:k,onChange:qe,placeholder:"Search mindmaps by title...",className:"block w-full pl-10 pr-10 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 bg-white"}),k&&e("button",{onClick:ye,className:"absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500 hover:text-gray-700",children:e(Me,{size:16})})]})]}),je&&!re&&e("div",{className:"mt-4 mb-2",children:r("div",{className:"flex items-center gap-2 text-sm text-blue-600 bg-blue-50 px-3 py-2 rounded-md",children:[e(Be,{size:14}),e("span",{children:"Showing cached data (refreshes automatically every 5 minutes)"})]})}),e("div",{className:"mt-6",children:re?e("div",{className:"flex justify-center items-center h-60",children:e("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500"})}):M.length===0?r("div",{className:"text-center py-12",children:[e(Ee,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),e("h3",{className:"text-xl font-medium text-gray-700 mb-2",children:"No Results Found"}),e("p",{className:"text-gray-500 max-w-md mx-auto mb-6",children:"No mindmaps match your search criteria. Try a different search term or clear the filters."}),r("div",{className:"flex flex-wrap justify-center gap-3",children:[e("button",{className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 transition-colors",onClick:ye,children:"Clear Search"}),E.length>0&&e("button",{className:"px-4 py-2 bg-indigo-100 text-indigo-700 rounded-md hover:bg-indigo-200 transition-colors",onClick:Oe,children:"Clear Tag Filters"})]})]}):I==="folder"?e(We,{}):r(tt,{children:[r("div",{className:"hidden sm:grid grid-cols-12 py-3 px-4 text-sm font-medium text-gray-500 border-y border-gray-200",children:[e("div",{className:"col-span-6 md:col-span-5",children:"Title"}),e("div",{className:"col-span-3 md:col-span-3",children:"Tags"}),e("div",{className:"col-span-2 md:col-span-2 text-right",children:"Actions"})]}),e("ul",{className:"divide-y divide-gray-200 text-left",children:Le.map(t=>r("li",{className:"py-4 px-4 hover:bg-gray-50 transition-colors",children:[e("div",{className:"flex flex-col gap-3 sm:hidden",children:r("div",{className:"flex-1 min-w-0",children:[r("div",{onClick:async()=>await z(t),className:"group relative",children:[e("h3",{className:"font-medium text-indigo-600 break-words hover:text-indigo-700 transition-colors cursor-pointer",children:t.title||"Untitled Mindmap"}),t.score!==null&&r("div",{className:"flex items-center gap-2 text-sm text-amber-600 mb-2",children:[e(F,{size:14,className:"shrink-0"}),r("span",{className:"truncate",children:["Score: ",t.score]})]}),ne===t.id&&e("div",{className:"absolute inset-0 bg-white/50 backdrop-blur-sm flex items-center justify-center rounded-lg",children:e("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-600"})})]}),t.tags&&t.tags.length>0&&e("div",{className:"flex flex-wrap gap-1.5 mt-2",children:t.tags.map((a,i)=>r("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-indigo-50 text-indigo-700",children:["#",a]},i))}),r("div",{className:"flex flex-col gap-2 mt-2 text-sm text-gray-500",children:[r("div",{className:"flex items-center gap-2",children:[e(R,{size:14,className:"shrink-0"}),ae(t.createdAt)]}),t.checkBy&&r("div",{className:"flex items-center gap-2 text-sm text-emerald-600",children:[e(W,{size:14,className:"shrink-0"}),e("span",{className:"truncate",children:t.checkBy===s.email?`Author: ${t.email}`:"Evaluated"})]}),t.score!==null&&t.score!==void 0&&r("div",{className:"flex items-center gap-2 text-sm text-amber-600",children:[e(F,{size:14,className:"shrink-0"}),r("span",{className:"truncate",children:["Score: ",t.score]})]})]}),r("div",{className:"flex items-center gap-2 mt-2",children:[e("button",{onClick:()=>J(t),className:"p-2 rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors","aria-label":t.checkBy?t.checkBy===s.email?"Email to author":"Email to evaluator":"Share via email",title:t.checkBy?t.checkBy===s.email?"Email to author":"Email to evaluator":"Share via email",children:e(X,{size:18})}),e("button",{onClick:()=>V(t.id),className:S("p-2 rounded-lg transition-all duration-200",q===t.id?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"),"aria-label":"Share mindmap",children:e(K,{size:18})}),e("button",{onClick:async()=>await z(t),className:"p-2 rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200 transition-all duration-200 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2","aria-label":"Edit mindmap",children:e(Z,{size:18})}),x!=="evaluated"&&e("button",{onClick:()=>Q(t.id),disabled:L,className:"p-2 rounded-lg bg-gray-100 text-red-600 hover:bg-red-50 transition-all duration-200 focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Delete mindmap",children:e(ee,{size:18})})]})]})}),r("div",{className:"hidden sm:grid grid-cols-12 items-center gap-4",children:[r("div",{className:"col-span-6 md:col-span-5",children:[r("div",{onClick:async()=>await z(t),className:"group relative",children:[e("h3",{className:"font-medium text-indigo-600 break-words hover:text-indigo-700 transition-colors cursor-pointer",children:t.title||"Untitled Mindmap"}),t.score!==null&&r("div",{className:"flex items-center gap-2 text-sm text-amber-600 mt-2 mb-2",children:[e(F,{size:14,className:"shrink-0"}),r("span",{className:"truncate",children:["Score: ",t.score]})]}),r("div",{className:"mt-2 flex items-center gap-2 text-sm text-gray-500",children:[e(R,{size:14,className:"shrink-0"}),ae(t.createdAt)]}),ne===t.id&&e("div",{className:"absolute inset-0 bg-white/50 backdrop-blur-sm flex items-center justify-center rounded-lg",children:e("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-600"})})]}),t.checkBy&&r("div",{className:"flex items-center gap-2 text-sm text-emerald-600 mt-1",children:[e(W,{size:14,className:"shrink-0"}),e("span",{className:"truncate",children:t.checkBy===s.email?t.email:"Evaluated"})]})]}),e("div",{className:"col-span-3 md:col-span-3",children:t.tags&&t.tags.length>0&&e("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map((a,i)=>r("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-indigo-50 text-indigo-700",children:["#",a]},i))})}),r("div",{className:"col-span-2 md:col-span-2 flex items-center justify-end gap-2",children:[e("button",{onClick:()=>J(t),className:"p-2 rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors","aria-label":t.checkBy?t.checkBy===s.email?"Email to author":"Email to evaluator":"Share via email",title:t.checkBy?t.checkBy===s.email?"Email to author":"Email to evaluator":"Share via email",children:e(X,{size:18})}),e("button",{onClick:()=>V(t.id),className:S("p-2 rounded-lg transition-all duration-200",q===t.id?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"),"aria-label":"Share mindmap",children:e(K,{size:18})}),e("button",{onClick:()=>z(t),className:"p-2 rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200 transition-all duration-200 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2","aria-label":"Edit mindmap",children:e(Z,{size:18})}),x!=="evaluated"&&e("button",{onClick:()=>Q(t.id),disabled:L,className:"p-2 rounded-lg bg-gray-100 text-red-600 hover:bg-red-50 transition-all duration-200 focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Delete mindmap",children:e(ee,{size:18})})]})]})]},t.id))}),r("div",{className:"mt-8 flex flex-col sm:flex-row justify-between items-center gap-4",children:[(k||E.length>0)&&r("div",{className:"text-sm text-gray-600",children:[e("span",{className:"font-medium",children:M.length})," ","mindmap",M.length!==1?"s":""," found",k&&r("span",{className:"inline-flex items-center gap-1",children:[" ","matching"," ",r("span",{className:"font-medium",children:['"',k,'"']})]}),E.length>0&&r("span",{className:"inline-flex items-center gap-1",children:[" ","with tags:"," ",e("span",{className:"font-medium",children:E.map(t=>`#${t}`).join(", ")})]})]}),D>1&&r("nav",{className:"flex items-center gap-1","aria-label":"Pagination",children:[e("button",{onClick:()=>be(B-1),disabled:B===1,className:"p-2 rounded-lg bg-white border border-gray-300 text-gray-700 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-all duration-200 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2","aria-label":"Previous page",children:e(nt,{size:16})}),r("span",{className:"px-4 py-2 text-sm text-gray-700",children:["Page ",e("span",{className:"font-medium",children:B})," of"," ",e("span",{className:"font-medium",children:D})]}),e("button",{onClick:()=>be(B+1),disabled:B===D,className:"p-2 rounded-lg bg-white border border-gray-300 text-gray-700 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-all duration-200 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2","aria-label":"Next page",children:e(lt,{size:16})})]})]})]})})]}),De&&e(Ve,{onClose:()=>me(!1),onHideForever:Qe})]}):r("div",{className:"flex flex-col items-center justify-center h-[60vh] text-center p-4",children:[e("h2",{className:"text-2xl font-bold text-gray-800 mb
26-4",children:"Please Login"}),e("p",{className:"text-gray-600",children:"You need to be logged in to view your mindmaps."})]})},Vt=Object.freeze(Object.defineProperty({__proto__:null,MindmapHistory:vt},Symbol.toStringTag,{value:"Module"}));export{vt as M,mt as a,Vt as b,Qt as c,te as g};

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.